react-native-push-notification icon indicating copy to clipboard operation
react-native-push-notification copied to clipboard

Add setShowBadge support for Android channel

Open serjek opened this issue 4 years ago • 5 comments

Feature Request

Add optional param for channel that will contribute to setShowBadge method on native side. PR is pending.

Why it is needed

Main reason for this is because on some devices badge is incremented automatically and can not be removed even with setApplicationIconBadgeNumber. We wouldn't want to annoy user with badges increasing when it is not really needed so option to disable badge per channel will become handy.

Possible implementation

Simply extend RNPushNotificationHelper.checkOrCreateChannel with extra param and use channel.setShowBadge(value);

Code sample

PushNotification.createChannel({channelId: "no_badge_channel", channelName: "Housekeeping notifications", showBadge: false});

serjek avatar Jul 11 '21 13:07 serjek

+1 for this change

rakesho-vel avatar Sep 07 '21 03:09 rakesho-vel

+1 for this change

nilsorathiya avatar Oct 01 '21 13:10 nilsorathiya

I want to hide badge on Android

2sem avatar Jun 16 '23 06:06 2sem

You can use dev branch for that, or just cherrypick this commit: https://github.com/zo0r/react-native-push-notification/commit/337663375f4dc1486c70f9e35677d6f056780db5 and make a patch-package

serjek avatar Jun 16 '23 07:06 serjek