Question: We sent a push and incremented the badge. Users report the badge does not disappear when they open the app. Is this expected? Could we send a silent push to decrease the badge instead?
Answer: Yes, this is expected. Pushwoosh sets the badge value that the notification carries; clearing it is the application's job. Reset the badge from your app code when the app is opened:
-
Set an absolute value — call the SDK's "set badge number" method with
0on app open to clear the badge. -
Change it relatively — call the SDK's "add badge number" method with a negative delta (for example
-1) to decrement the existing value.
Using the Pushwoosh badge API rather than the platform API directly is important: it keeps the badge counter stored on the Pushwoosh side in sync, so subsequent incremental badge pushes are calculated from the correct base.
Platform references:
- iOS: PushwooshFramework SDK reference; see also [iOS] Updating iOS app icon badge via Silent Push Notifications.
- Android: Android SDK documentation; note that app-icon badges on Android are launcher-dependent — see [Android] Badges: Challenges and Limitations.
Sending a silent push to decrement the badge does work, but be aware of the side effect: it also decrements the badge for users who never opened the app and still have unread messages, so their counter will drift away from reality. Clearing the badge on app open is the reliable approach.
Comments
0 comments
Please sign in to leave a comment.