cordova-plugin-badge icon indicating copy to clipboard operation
cordova-plugin-badge copied to clipboard

Badge not display on app icon in android

Open Hardik21 opened this issue 7 years ago • 25 comments
trafficstars

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.

Hardik21 avatar Aug 24 '18 06:08 Hardik21

I had the same issue

AltRoot17 avatar Aug 27 '18 07:08 AltRoot17

I had the same issue samsung s9 plus, android 8.1

androidhoya avatar Sep 05 '18 06:09 androidhoya

Any solutions ?

AltRoot17 avatar Sep 05 '18 06:09 AltRoot17

not yet any solution.

Hardik21 avatar Sep 07 '18 06:09 Hardik21

Any solutions now?

MeCalcifer avatar Oct 03 '18 13:10 MeCalcifer

Works fine on Xperia XZ - Android 8.0.0

I'm looking for a solution for Samsung devices..

SullyvanCrow avatar Oct 10 '18 14:10 SullyvanCrow

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

fbrun avatar Oct 30 '18 12:10 fbrun

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.

katzer avatar Nov 09 '18 09:11 katzer

Same issue on Google Pixel with Android 9

nocodedweb avatar Nov 13 '18 16:11 nocodedweb

Same issue on MIUI 10 with Android 8.1

paulvales avatar Jan 13 '19 05:01 paulvales

same here on xiaomi mi 2

stefanwilliam96 avatar Jan 16 '19 06:01 stefanwilliam96

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.

dland512 avatar Feb 04 '19 18:02 dland512

Same issue here. Calling badge.isSupported() always return false. I tried with several devices and got the same response.

gusespinoza avatar Feb 06 '19 15:02 gusespinoza

yes,I have a same issue.Why the badge can't display?

huaqingtian1111 avatar Mar 06 '19 06:03 huaqingtian1111

xiaomi note 2, have a same issue

cnryb avatar May 21 '19 06:05 cnryb

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?

slowsquirrel69 avatar Jun 29 '19 02:06 slowsquirrel69

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.

SergTomcat avatar Jul 19 '19 14:07 SergTomcat

Same issue here @katzer will you work on it ?

Aarbel avatar Aug 16 '19 13:08 Aarbel

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

Harmonickey avatar Aug 16 '19 23:08 Harmonickey

Thank you @Harmonickey, so were're waiting for ShortcutBadger udpate.

Aarbel avatar Aug 18 '19 19:08 Aarbel

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.

qamrulhaque avatar Feb 20 '20 16:02 qamrulhaque

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 avatar Feb 21 '20 11:02 qamrulhaque

@qamrulhaque hmm so you're using 8.2.0 ?

https://www.npmjs.com/package/cordova-android

Aarbel avatar Feb 21 '20 11:02 Aarbel

Still doesn't work on "cordova-android": "9.1.0"

Any news ?

evgeniy-skakun avatar Dec 06 '21 09:12 evgeniy-skakun

same issue, any update?

ash737 avatar Aug 12 '22 09:08 ash737