react-native-push-notification
react-native-push-notification copied to clipboard
Add setShowBadge support for Android channel
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});
+1 for this change
+1 for this change
I want to hide badge on Android
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