Page 1 of 2

pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Posted: Sun Mar 30, 2014 2:34 pm
by GodSpeed JP1

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?


pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Posted: Sun Mar 30, 2014 6:54 pm
by Igor

Hello,

Lets see if this help
https://getsatisfaction.com/apperyio/...


pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Posted: Mon Mar 31, 2014 3:28 am
by GodSpeed JP1

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)


pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Posted: Tue Apr 01, 2014 10:18 am
by Kateryna Grynko

Hi,

You can also check this: http://stackoverflow.com/questions/19...


pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Posted: Tue Apr 01, 2014 5:39 pm
by GodSpeed JP1

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


pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Posted: Wed Apr 02, 2014 5:26 am
by Kateryna Grynko

Did you add the plug-in to your project?
http://docs.appery.io/documentation/u...


pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Posted: Wed Apr 02, 2014 6:26 am
by GodSpeed JP1

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


pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Posted: Wed Apr 02, 2014 7:26 am
by Kateryna Grynko

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


pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Posted: Wed Apr 02, 2014 2:17 pm
by GodSpeed JP1

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?


pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Posted: Thu Apr 03, 2014 5:45 am
by GodSpeed JP1

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?