This 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 :)
You can fork and commit to your repos :D
@codevoler that is an option sure but then it gives you headaches with merging on every new release.
@kneza23 but i will work around with you for this time :D
@codevoler there are few active pull requests that are trying to solve this same problem, i think there is no need for me to do it also :)
Please @zo0r, keep this issue in mind. It's very important on Android to make proper use of the notification channels.
Hi,
This change is important, but couldn't simply be solved by a magic entry in the AndroidManifest since a part of the channel_id is dynamic.
In the current state of the Library, I'm not sure this change will solve the real problem of channel management.
A commit has been made on dev.
You can install it for testing purpose:
npm install zo0r/react-native-push-notification#dev
OR
yarn add zo0r/react-native-push-notification#dev
It's working like #1159 README.md has been updated on dev
Also, another pending change allow you more action on channels:
https://github.com/zo0r/react-native-push-notification/issues/1432#issuecomment-633441930
Hi, the release 4.0.0 of the library should solve this issue, feel free to reopen if something is missing 馃槈
Cool! Thanks!
Also a pending PR will allow directly create channels inside the Application.
Most helpful comment
A commit has been made on
dev.You can install it for testing purpose:
It's working like #1159
README.mdhas been updated ondevAlso, another pending change allow you more action on channels:
https://github.com/zo0r/react-native-push-notification/issues/1432#issuecomment-633441930