GodSpeed JP1
Posts: 0
Joined: Thu Feb 27, 2014 1:23 pm

pushNotification.setApplicationIconBadgeNumber can't clean the badge.

I use pushNotification.setApplicationIconBadgeNumber to clean the push badge in device ready event.
But it is not working(iOS 7.0.6).My js code is below:

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
window.plugins.pushNotification.setApplicationIconBadgeNumber(successCallback, errorCallback, 0);
}

Anything wrong with it?

GodSpeed JP1
Posts: 0
Joined: Thu Feb 27, 2014 1:23 pm

pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Hello Igor,
I did it with your link, but it didn't work.
You can see my source codes are same to yours.
I debug the code, I find that process run into the line :
"window.plugins.pushNotification.setApplicationIconBadgeNumber(successCallback, errorCallback, 0); "
but , nothing changed,and no error.
Could you check it in your environment?
I have tested it on my real device iPhone5s iOS7.0.6.(Phonegap 3.3.0)

GodSpeed JP1
Posts: 0
Joined: Thu Feb 27, 2014 1:23 pm

pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Hi Katya, I tried that, it does not work.

GodSpeed JP1
Posts: 0
Joined: Thu Feb 27, 2014 1:23 pm

pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Hi Katya,
You means I have to install some 3rd part plugins except for cordova.plugins.PushNotification?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

pushNotification.setApplicationIconBadgeNumber can't clean the badge.

No. There is a link to this plug-in in the suggested solution on stackoverflow site.

GodSpeed JP1
Posts: 0
Joined: Thu Feb 27, 2014 1:23 pm

pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Hi Katya , I am not sure how to install this plugin even saw your tutorial.
I created the folder and upload .js,.h,.m files into it like the tutorial,then config the cordova_plugins.js
like:
{
"file": "plugins/de.appplant.cordova.plugin.badge/www/badge.js",
"id": "de.appplant.cordova.plugin.badge",
"clobbers": ["plugin.notification.badge"]
}
*I am not sure what the clobbers should be.

Then I add the line
&lt gap:plugin name="de.appplant.cordova.plugin.badge" /&gt
in to the config.xml

But it does not work.
Anything wrong in my configs?

GodSpeed JP1
Posts: 0
Joined: Thu Feb 27, 2014 1:23 pm

pushNotification.setApplicationIconBadgeNumber can't clean the badge.

I found the problem, I alert (window.plugins.pushNotification) on device, but it is undefinded.
I have config in config.xml and I can recive push.
&lt feature name="PushNotification"&gt
&lt param name="ios-package" value="PushNotification" /&gt
&lt /feature &gt
But why window.plugins.pushNotification is undefinded on device?

Return to “Issues”