-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] Allow to change default notification channel name after it's creation #1549
Comments
Hi @juancruzgs |
I was thinking Android SDK doesn't allow this. |
You can test this on |
Thank you so much @Dallas62 Sorry for my mistake comparing strings, I was comparing them like in Kotlin code |
No problem, I just remember after the change that in Java this is a reference comparison 😉 |
* dev: (28 commits) Release version 5.0.0. Fix behaviour of popInitialNotification and onNotification. Fix foreground value. fix popInitialNotification and null pointer Apply changes to popInitialNotification. make sure data/userInfo is an object before spreading keep notification data from fcm while populating data userInfo Fix case of small/large icon null. Add tests for channel update. #1549 Update CHANGELOG.md [Android] Allow to change default notification channel name after it's creation #1549 align onNotification on both platforms Rename `channelDesc` to `channelDescription`. Update code from recent PR for scheduled notifications return notification id in onNotification method on iOS populate userInfo with id on both platforms revert changes reflecting userInfo working on both platforms in documentation and example "@react-native-community/push-notification-ios": "^1.3.0" add data to android notification when scheduling Add docs for icon strings ... # Conflicts: # README.md
Released 😉 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions. |
Feature Request
The library doesn't allow to change the default notification channel name after it is created.
We are changing this value in the
AndroidManifest.xml
but it won't do anything if the channel is already created in the device.The user would have to re-install the app to see the change.
A workaround would be to either delete the channel and wait until the library re-creates it or get all the channels from the
NotificationManager
and change it in our own.Why it is needed
In our case we need to change the channel name because it was initially created with the wrong name.
But it's also useful to change the channel name if the device locale changes.
Possible implementation
The
NotificationManager
will update the channel name if it's already created when callingNotificationManager#createNotificationChannel(channel)
.Documentation:
You could change the
channel == null
check from this code and callmanager#createNotificationChannel(channel)
if the name/description changes.Code sample
RNPushNotificationHelper line 902
The text was updated successfully, but these errors were encountered: