The method Pushwoosh.getInstance.setApplicationIconBadgeNumber(0); is the correct way to clear the application icon badge. However, its visual effect on Android can be inconsistent.
This is because Android does not have a single, officially supported API for managing badge counts. The display of badges is handled by the device's specific launcher (e.g., Samsung One UI, Google Pixel Launcher), and each launcher can implement this functionality differently. As a result, the badge may not always clear immediately or may behave differently across various devices and Android versions.
To verify that the SDK is functioning correctly, you can programmatically retrieve the badge number after setting it. This confirms that the value has been updated internally, even if the launcher's UI has not yet reflected the change.
Here is a code snippet for testing:
// To reset the badge count
Pushwoosh.getInstance.setApplicationIconBadgeNumber(0);
// To get the current badge count and verify it was set
int badgeNum = await Pushwoosh.getInstance.getApplicationIconBadgeNumber;
print('Current badge number is: $badgeNum');
Comments
0 comments
Please sign in to leave a comment.