Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Badge not display on app icon in android #124

Open
Hardik21 opened this issue Aug 24, 2018 · 25 comments
Open

Badge not display on app icon in android #124

Hardik21 opened this issue Aug 24, 2018 · 25 comments

Comments

@Hardik21
Copy link

Hardik21 commented Aug 24, 2018

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 Hardik21 changed the title Ionic 3 badge not display on app icon Badge not display on app icon Aug 24, 2018
@Hardik21 Hardik21 changed the title Badge not display on app icon Badge not display on app icon in android Aug 24, 2018
@AltRoot17
Copy link

I had the same issue

@androidhoya
Copy link

androidhoya commented Sep 5, 2018

I had the same issue
samsung s9 plus, android 8.1

@AltRoot17
Copy link

Any solutions ?

@Hardik21
Copy link
Author

Hardik21 commented Sep 7, 2018

not yet any solution.

@MeCalcifer
Copy link

Any solutions now?

@SullyvanCrow
Copy link

Works fine on Xperia XZ - Android 8.0.0

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

@fbrun
Copy link

fbrun commented Oct 30, 2018

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

@katzer
Copy link
Owner

katzer commented Nov 9, 2018

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.

@nocodedweb
Copy link

Same issue on Google Pixel with Android 9

@paulvales
Copy link

Same issue on MIUI 10 with Android 8.1

@stefanwilliam96
Copy link

same here on xiaomi mi 2

@dland512
Copy link

dland512 commented Feb 4, 2019

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.

@gusespinoza
Copy link

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

@huaqingtian1111
Copy link

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

@cnryb
Copy link

cnryb commented May 21, 2019

xiaomi note 2, have a same issue

@slowsquirrel69
Copy link

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?

@SergTomcat
Copy link

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.

@Aarbel
Copy link

Aarbel commented Aug 16, 2019

Same issue here @katzer will you work on it ?

@Harmonickey
Copy link

Harmonickey commented Aug 16, 2019

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
leolin310148/ShortcutBadger#266

@Aarbel
Copy link

Aarbel commented Aug 18, 2019

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

@qamrulhaque
Copy link

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
Copy link

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.

@Aarbel
Copy link

Aarbel commented Feb 21, 2020

@qamrulhaque hmm so you're using 8.2.0 ?

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

@evgeniy-skakun
Copy link

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

Any news ?

@ash737
Copy link

ash737 commented Aug 12, 2022

same issue, any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests