Closed ramsabarish closed 9 years ago
Have you tried to use the Badge plugin: https://build.phonegap.com/plugins/1123
No I haven't tried Badge plugin: https://build.phonegap.com/plugins/1123
As soon as we tap on an App icon the badge for notification should be removed. So can you Kindly tell me have I missed any step that will remove the Badge. Well I don't have this issue on Android.
If using PhoneGap Build - I'd recommend the plugin repository for the latest versions:
<gap:plugin name="de.appplant.cordova.plugin.local-notification" source="plugins.cordova.io" version="0.7.8" />
<gap:plugin name="de.appplant.cordova.plugin.badge" source="plugins.cordova.io" version="0.6.1" />
When you open your App, you can clear all badges after deviceready - you can clean up all badges using the Badge plugin:
cordova.plugins.notification.badge.clear();
Also, if the user clicks the notification you can setup a callback, and here you can manage the badge/s to be removed on an individual bases (more is documented in the plugin readme regarding sending a useful JSON object):
window.plugin.notification.local.onclick = function (id, state, json) {
cordova.plugins.notification.badge.set(-1) //to remove one badge
alert("NOTIFICATION ID: " + id + " JSON:" + JSON.parse(json).youritem);
}
I have successfully schedule the notification by this code .
window.plugin.notification.local.add({ title: eventName, message: description, date: schedule_now, smallIcon: 'ic_dialog_email', icon: 'file://img/smallLogo.png' });
But after this a Red Circle with a number appears on my App icon in iPhone. Even though I clear the notification on device, my App icon is marked with a Red Circle. How can I remove it once the user is notified with the event.