cordova-plugin-badge
cordova-plugin-badge copied to clipboard
Badge not display on app icon in android
this.badge.hasPermission().then((res) => {
// Success!
this.badge.set(10).then((res) => {
// Success!
alert("set badge");
}).catch((ex) => {
alert(JSON.stringify(ex));
});
}).catch((ex) => {
alert(JSON.stringify(ex));
});
This is my code. In this "set badge" alert popup. But still badge not display on app icon.
I had the same issue
I had the same issue samsung s9 plus, android 8.1
Any solutions ?
not yet any solution.
Any solutions now?
Works fine on Xperia XZ - Android 8.0.0
I'm looking for a solution for Samsung devices..
Same issue on a samsung galaxy tab with android 8.0.0, but the badge appear when a new push notification is received, then after opening the app, badge is removed
Please notice that the plugin only supports devices that are supported by ShortcutBadger. There's no error if its not possible to set a badge. The cordova plugin nor the underlying ShortcutBadger cannot know if its working or not because its not a core Android API.
Same issue on Google Pixel with Android 9
Same issue on MIUI 10 with Android 8.1
same here on xiaomi mi 2
Is it device dependent or launcher dependent? The ShortcutBadger page indicates that its launcher dependent. I have a Razer running Oreo 8.1 and I can't get it to work. I tried installing several launchers listed on the ShortcutBadger page (Nova, OPPO, KISS, ASUS) and none of them seem to work.
Calling cordova.plugins.notification.badge.hasPermission() returns true. Likewise, calling cordova.plugins.notification.badge.increase() returns the expected result it just doesn't seem to affect the icon on the home screen.
Same issue here. Calling badge.isSupported() always return false. I tried with several devices and got the same response.
yes,I have a same issue.Why the badge can't display?
xiaomi note 2, have a same issue
Any update on this as we are having the same issue? Is there a way to modify the APK generated by PhoneGap and add the native Android calls for badges?
Tried set badge via payload, cold call, hot call. Functions result with a success, i can read the correct badge count, but it just doesn't show up visually. We need some solution.
Same issue here @katzer will you work on it ?
I believe many Android models (including for Samsung S8) don't support badge via ShortcutBadger (which is the plugin used underneath cordova-plugin-badge for android). The only way to set the badge is to use a push notification. At least, that's what I've observed in my own testing.
Here's some information about Android 8 https://developer.android.com/training/notify-user/badges.html
And it appears this issue is ongoing https://github.com/leolin310148/ShortcutBadger/issues/266
Thank you @Harmonickey, so were're waiting for ShortcutBadger udpate.
Badge shows in "Ionic devapp" when using "ionic serve --devapp". Badge doesn't show in app generated by capacitor. If badge is showing in devapp then it means launcher does support badges. Why is it not showing in app with same code? Only thing I notice is that devapp has setting "App icon badges" under phone Settings -> Notifications. But the app generated by capacitor doesn't have this setting option although it has all other notification settings except badge.
Just replaced "cordova-android" from "8.1.0" to "^8.1.0" in package.json and badge is working now with both cordova and capacitor.
@qamrulhaque hmm so you're using 8.2.0 ?
https://www.npmjs.com/package/cordova-android
Still doesn't work on "cordova-android": "9.1.0"
Any news ?
same issue, any update?