Closed MatthieuPeyrot closed 7 years ago
Have the same issue but using the last version of me.leolin:ShortcutBadger:1.1.18@aar doesn't fix it.
Me neither
@MatthieuPeyrot I'm unable to reproduce this. Can you send the contents of your app/build.gradle
?
hi i maybe find a solution i don't have the red screen by adding this in the build.gradle
repositories { mavenCentral() }
but the notif badge don't change on my samsung device.
The ShortcutBadger lib has an app to test if it works on your phone: https://play.google.com/store/apps/details?id=me.leolin.isbadgeworking
I got the link from their repo: https://github.com/leolin310148/ShortcutBadger
We tried it on several phones and only one of them actually showed the badge
it work on the samsung galaxy s5 (android 6 )but not on the s6 edge (android 7 ) But i have to add compile 'me.leolin:ShortcutBadger:1.1.18@aar' and repositories { mavenCentral() } on my build.gradle not on react native firebase that's weird
I've updated the dependency to the latest version of Shortcut Badger for the upcoming v3 release
Still happen this problem with the last version. I don't know why because i can see ShortcutBadger exported like a Library in the react-native-firebase project. But it works like @MatthieuPeyrot said. Could be my version of gradle (2.3.3)? is necessary to have 3.0> ?
This still happens with latest build.
There is no documentation after v3.3.x. I think they had remove it.
Still happening with 4.2.0
implementation "com.google.firebase:firebase-messaging:17.1.0" implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
I've downloaded the 'isBadgeWorking?' in a Samsung and it's working. But it does not work when my app receives a message and shows the notification.
About this, it got a simple method. Follow the step below. react-native-push-notifications-with-firebase-cloud-functions
Use below payload while sending notification.
let payload = {
notification: {
title:
body:
sound:
badge:
}
}
Or,
Use firebase console to send a notification to your mobile phone by token. Of course, you can also send a notification to all mobile that use the app.
if your phone receive notification, mean it works. if not, there is something wrong with your setting.
Finally as for this thread issue, you need to use
firebase.notifications().setBadge(10). //to set badge number
firebase.notifications().getBadge() // to get badge number
implementation "com.google.firebase:firebase-messaging:17.1.0" implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
I've downloaded the 'isBadgeWorking?' in a Samsung and it's working. But it does not work when my app receives a message and shows the notification.
thanku so much @turboc . u saved my day.
Careful - ShortcutBadger hasn't really been updated in 2 years https://github.com/leolin310148/ShortcutBadger - it doesn't work on all vendors and Google specifically will not support badging. Attempting to do badging on Android is fighting the platform - something that always results in resources spent for little gain
Hi, I have a issue: setBadge(0) in android not working , getBadge() in android is 0 but in icon app show number >0.
const currentNumber = await firebase.notifications().getBadge()
console.log('currentNumber ', currentNumber) // in here currentNumber = 0
if (number <= 0) {
await firebase.notifications().setBadge(0)
// go to here but in icon app, badge >0
} else {
await firebase.notifications().setBadge(number)
}
Please help me. "react-native-firebase": "5.5.6" "react-native": "0.63.3"
No help whatsoever is offered for react-native-firebase v5 And specifically, badging in general is an anti-pattern on Android because it is not part of the platform and specifically not a desired feature in AOSP. It was removed on purpose
Hi
I have an issue on my samsung galaxy S6 , it crash when i try to update the badgeNumber. I thing it because you are not using the last version of ShortcutBadger
you are using : compile 'me.leolin:ShortcutBadger:1.1.10@aar' now it's : compile 'me.leolin:ShortcutBadger:1.1.18@aar'
that's the crash :
0 | io.invertase.firebase.messaging.BadgeHelper.setBadgeCount | BadgeHelper.java:33 1 | io.invertase.firebase.messaging.MessagingService.handleBadge | MessagingService.java:41 2 | io.invertase.firebase.messaging.MessagingService.onMessageReceived | MessagingService.java:23 3 | com.google.firebase.messaging.FirebaseMessagingService.handleIntent | Unknown Source 4 | com.google.firebase.iid.zzc.run | Unknown Source 5 | java.util.concurrent.ThreadPoolExecutor.runWorker | ThreadPoolExecutor.java:1133 6 | java.util.concurrent.ThreadPoolExecutor$Worker.run | ThreadPoolExecutor.java:607 7 | java.lang.Thread.run | Thread.java:762