You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since it isn't possible (as far as I know) to get/set the badge count programmatically in OneSignal, I've used this library https://github.com/zo0r/react-native-push-notification#ios-only-methods and this function: PushNotification.setApplicationIconBadgeNumber(number: number) to reset the badge count in my application in addition to using OneSignal.
However, when I make the call to PushNotification.setApplicationIconBadgeNumber(number: number) OneSignal will still increment the badge count continuously, not respecting this badge count.
How to reproduce:
turn off OneSignal badge clearing: OneSignal_disable_badge_clearing in Info.plist
Send a notification from OneSignal Dashboard
Open app, the badge icon is now cleared due to the call to PushNotification.setApplicationIconBadgeNumber(number: number)
Send another push notification from OneSignal Dashboard
Note the badge count on the app icon was never really set to 0 in OneSignal, it was incremented
Question: How do I reset the badge count so that OneSignal doesn't continuous increment the badge count each time the push comes in.
Note: I believe what is happening here is that when the badge count is set to 0 in the client, OneSignal is not made aware of it in the cloud, so it keeps on incrementing the number. What is needed is a way to tell OneSignal the the badge count has been set to 0.
For future reference, the OneSignal SDK will not touch the badge count unless:
Your push notification contains ios_badgeCount and ios_badgeType parameters.
Your info.plist file contains OneSignal_disable_badge_clearing key. This controls how the OneSignal SDK will handle clearing badge count when the user opens the app. If set to false, the SDK will not touch the badge count and it is up to your app to clear the badge count.
Instead of using a third party SDK to set the badge count, all you have to do is called `UIApplication.setApplicationIconBadgeNumber("0") to clear the badge count.
Closing this issue due to inactivity, please feel free to respond if you are still encountering this issue.
Since it isn't possible (as far as I know) to get/set the badge count programmatically in OneSignal, I've used this library https://github.com/zo0r/react-native-push-notification#ios-only-methods and this function:
PushNotification.setApplicationIconBadgeNumber(number: number)
to reset the badge count in my application in addition to using OneSignal.However, when I make the call to
PushNotification.setApplicationIconBadgeNumber(number: number)
OneSignal will still increment the badge count continuously, not respecting this badge count.How to reproduce:
OneSignal_disable_badge_clearing
in Info.plistPushNotification.setApplicationIconBadgeNumber(number: number)
Question: How do I reset the badge count so that OneSignal doesn't continuous increment the badge count each time the push comes in.
Note: I believe what is happening here is that when the badge count is set to 0 in the client, OneSignal is not made aware of it in the cloud, so it keeps on incrementing the number. What is needed is a way to tell OneSignal the the badge count has been set to 0.
Related: #62
cc @avishayil
The text was updated successfully, but these errors were encountered: