Channel name updated when sending local notification
See original GitHub issueI have created custom channel:
PushNotification.createChannel(
{
channelId: 'myid',
channelName: 'Channel Name',
channelDescription: 'Channel Description',
},
created => console.log(create)
);
and then somewhere in my code I created new local notification:
PushNotification.localNotification({
title: 'Title',
message: 'Message',
channelId: 'myid',
});
After this my channel name has been updated back to default value: ‘rn-push-notification-channel’
Looks like this is caused by this check: https://github.com/zo0r/react-native-push-notification/blob/master/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java#L946 Is it intentional behavior?
Based on source code I was able to find workaround by providing channelName and channelDescription when sending notification, however these attributes are not documented.
PushNotification.localNotification({
title: 'Title',
message: 'Message',
channelId: 'myid',
channelName: 'Channel Name',
channelDescription: 'Channel Description',
});
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10
Top Results From Across the Web
Create and Manage Notification Channels - Android Developers
Create a notification channel · Construct a NotificationChannel object with a unique channel ID, a user-visible name, and an importance level.
Read more >Notification channels: Control where to send alerts
To set up a new notification channel: On the Notification channels, click New notification channel. Select the type of channel and complete other...
Read more >Creating Local Notifications in Flutter - Kodeco
Learn how to create cross-platform local notifications in Flutter using ... to define a channel ID and name of the notification for Android....
Read more >User Notifications | Apple Developer Documentation
Notifications can display an alert, play a sound, or badge the app's icon. You can generate notifications locally from your app or remotely...
Read more >Flutter Local Notification - Nitish Kumar Singh - Medium
async { ; var androidPlatformChannelSpecifics = ; new AndroidNotificationDetails( ; 'your channel id', ; 'your channel name', ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just released 😉
I tested with
dev
branch and it works correctly for me - channel name is not overwritten to default name anymore.Thank you for help!