This repository was archived by the owner on Jan 14, 2025. It is now read-only.
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
Channel name updated when sending local notification #1649
Closed
Description
I 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',
});
Metadata
Metadata
Assignees
Labels
No labels