Closed rastafan closed 7 years ago
Alright, we managed to resolve.
The problem was that the badge number shown was originally set by phonegap-plugin-push, so this plugin was unable to retrive the correct badge value. In fact, setting the badge number using this plugin and then decreasing/getting/setting it works fine.
So, in the end, we modified the phonegap-plugin-push plugin so that it would set the badge value in the same SharedPreference key as this on notification arrival. This way, the value is always updated correctly.
Will try to make a pull request on to phonegap-plugin-push to make this official.
Thx!
@rastafan Yes, the issue is that Android has no app-wide API to set the badge. Thats why the plugin knows only about the value it has set itself.
Hi,
we noticed a strange behaviour on Android devices. Using "decrease", the badge number gets cleared instead of getting decreased. The same behaviour happens using get/set approach. We tried both with and without callback function.
Cordova: 6.5.0 Android Platform: 6.1.2 Plugin version: 0.7.4 Devices : SM-P605 (Android 5.1.1) and SM-T550 (Android 6.0.1)
Works fine on iOS.