0


I am trying to update the badge for a Phonegap 3.1 iOS application.


What Has Worked Before
To achieve this in older versions of Phonegap/Cordova, I used the following plugin: https://github.com/phonegap/phonegap-plugins/tree/master/iOS/Badge

Why that no longer works
Plugins in Phonegap 3.0+ are now installed via the command line. I'm under the impression that the plugin above (which has a "last updated" time of over a year ago) is not compliant with the new plugin install process.

What I've Thought to Try So Far
I thought to try and run phonegap local plugin add https://<path to the git repo> just incase the plugin still worked with 3.0+, but I can't seem to find the address of the actual repo.

I was hoping the Phonegap 3.0 documentation would have an example of setting the badge, but I don't see anything along those lines.


Does anyone know of a Phonegap3.0+ plugin to manually set of the badge number for an iOS app?
Paul
  • 529
  • 1
  • 6
  • 20

1 Answers1

1

https://github.com/katzer/cordova-plugin-badge

window.plugin.notification.badge.clear();
window.plugin.notification.badge.set(0);  // alternative

Pretty simpel. Can also be installed via CLI.

zk_mars
  • 1,339
  • 2
  • 15
  • 36
  • have you used this plugin to work in the background while the application is minimized? I'm using it in an application to update the badge every 5 minutes but it's updating the badge only when you're inside the application. I used another plugin to allow background tasking, which seems to be working, but once the time runs out when the application is on the background the badge doesn't refresh. – Juan Carlos Alpizar Chinchilla May 13 '14 at 21:55
  • I used it every time a notification in my application fired, it would update the badge like I wanted it to, also when the app was in the background. (After all isn't that the primary use and intention of the plugin?) However, I used Cordova 3.0, I am not sure if it still works properly with Cordova 3.4. I am having some issues with the 3.4 Version regarding other plugins. – zk_mars May 14 '14 at 19:15
  • yes I've heard the 3.4 is giving issues to some people, I'm using the 3.3 version atm. Could you make the updates without any other plugins in the background? I should check that out – Juan Carlos Alpizar Chinchilla May 14 '14 at 20:30