ios app badge with 1 value shows after app install (even before opening it for the first time)

  • 1
  • Question
  • Updated 4 years ago
I am building with PGB and cli 6. I did not roll back yet to 5 to see if this persists. also, I am using https://github.com/phonegap/phonegap-... for push notifications.
even if I uninstall and install the app the badge 1 value still appears
any ideas?
thanks.
Photo of gkatz

gkatz

  • 186 Posts
  • 5 Reply Likes

Posted 4 years ago

  • 1
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@gkatz,
I don't have an answer for you, maybe someone else on this forum does.
You can also try

- Google Group for Cordova/Phonegap
- Stackoverflow Phonegap Build
- SO has a phonegap-plugin section too.

Best of Luck
Jesse
Photo of gkatz

gkatz

  • 186 Posts
  • 5 Reply Likes
it might be a plugin issue.
I will try to go that route.
thanks
Photo of jcesarmobile

jcesarmobile

  • 283 Posts
  • 40 Reply Likes
For some reason the badge number is not resetted if you uninstall and re install the app. It has nothing to do with the plugin, it happens to me on native apps too.

You can try to use the setApplicationIconBadgeNumber method to set it to 0 again.


push.setApplicationIconBadgeNumber(function() {
console.log('success');
}, function() {
console.log('error');
}, 0);
Photo of gkatz

gkatz

  • 186 Posts
  • 5 Reply Likes
there's also something I have missed in the init method of the plugin. did you try it
?
PushNotification.init({
"ios": {
......
"clearBadge": "true"
}
});
Photo of jcesarmobile

jcesarmobile

  • 283 Posts
  • 40 Reply Likes
I have not tried, but should work too.
The problem is, using clearBadge or setApplicationIconBadgeNumber 0, both of them will delete the push notifications on notification center (if any)