The need of custom channel_id in android.
See original GitHub issueThis line of code should not be hardcoded. We should set it from the manifest.
private static final String NOTIFICATION_CHANNEL_ID = "rn-push-notification-channel-id";
Along with these:
<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_name"
android:value="New orders (in app)"/>
<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_description"
android:value="@string/default_notification_channel_desc"/>
Right now you can set name and description of the default channel.
But, if you want to reference that channel - backend/service fcm notification needs to set that channel_id rn-push-notification-channel-id
for you to reference to it, which is just bad practice.
There are few Pull requests that are trying to solve this problem @zo0r , it would be good to check and see if they can be merged 😃
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:10
Top Results From Across the Web
Create and Manage Notification Channels - Android Developers
Construct a NotificationChannel object with a unique channel ID, a user-visible name, and an importance level.
Read more >android - What "channelId" should I pass to the constructor of ...
This one is the ID of the channel. It tells which channel should be used to send that notification. You can assign any...
Read more >Android Notification Channel As Deep As Possible - ITNEXT
ChannelId is a unique String to identify each NotificationChannel and is used in Notification.Builder (line 7) when constructing the ...
Read more >Android: Notification Channel Categories
Set android_channel_id on the create notification REST API to the channel id of your category. This can be found at the top of...
Read more >Exploring Android O: Notification Channels | by Joe Birch
As of Android O, creating a Notification instance now requires a channel ID to be set by the use of the setChannel() method....
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 Free
Top 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
A commit has been made on
dev
. You can install it for testing purpose:It’s working like #1159
README.md
has been updated ondev
Also, another pending change allow you more action on channels: https://github.com/zo0r/react-native-push-notification/issues/1432#issuecomment-633441930
Please @zo0r, keep this issue in mind. It’s very important on Android to make proper use of the notification channels.