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

pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Anyone can help me ? My window.plugins.pushNotification does not work on real device.I can recive push.But I want to use window.plugins.pushNotificaiton in js to get the devcieToken and clean the badge .But It says windows.plugins.pushNotification is undefinded.
On real devcie ti show a white screen, means something wrong.
I am using Lib V2.0, and I checked the config of pushNotification in config.xml and checked the plugin file.I need anything special config?
I have been working in this for two days ,thanks for any reply.

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

pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Thank you Maryna,
I have shared my project to you.
My app's name is GF.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

pushNotification.setApplicationIconBadgeNumber can't clean the badge.

1) You don't need to invoke any .h,.m files into project, pushNotification plugin is added by default
2) You need to call plugin this way prePushNotification.setApplicationIconBadgeNumber(0, function(){});/pre3) There is a bug unfortunately - it doesn't work in 2.0 version, but works in 1.2

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

pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Thank you Maryna,when can you fix this bug?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Hello,

Planning to fix on Production with the next (mid-April) release.

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

pushNotification.setApplicationIconBadgeNumber can't clean the badge.

Hi,I can use PushNotification.setApplicationIconBadgeNumber command to clear the badge after update.
Thank you very much.
But I still can't get deviceToken,
How can I get deviceToken use PushNotification Class?
I tried the code below,but it not work.

Code: Select all

 var pushNotification = new PushNotification(); 

 pushNotification.onDeviceReady(); 

 pushNotification.registerDevice({ 
         alert: true, 
         badge: true, 
         sound: true 
     }, 

     function (status) { 
         alert(status); 
         var deviceToken = status['deviceToken']; 
         alert('registerDevice: ' + deviceToken); 
     }, 

     function (status) { 
         alert('failed to register : ' + JSON.stringify(status)); 
         navigator.notification.alert(JSON.stringify(['failed to register ', status])); 
     }); 

Could you give me a right way to get deviceToken by JS?

Return to “Issues”