zo0r / react-native-push-notification

React Native Local and Remote Notifications
MIT License
6.75k stars 2.05k forks source link

Add setShowBadge support for Android channel #2088

Open serjek opened 3 years ago

serjek commented 3 years ago

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});

rakesho-vel commented 3 years ago

+1 for this change

nilsorathiya commented 2 years ago

+1 for this change

2sem commented 1 year ago

I want to hide badge on Android

serjek commented 1 year ago

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