Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

Reset Push Badge

My app uses push notifications, and I'd like to turn on the Badge feature. When the person opens the app after a push notification, I want the badge number to reset. How do I make this happen?

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

Reset Push Badge

Hi, Doug.
Try this on Device Ready event
precodevar pushNotification = window.plugins.pushNotification;
pushNotification.setApplicationIconBadgeNumber(0);/code/pre

Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

Reset Push Badge

Perfect!

Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

Reset Push Badge

This code doesn't seem to be working any longer on iOS7. Anything else I need to do?

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

Reset Push Badge

testing...

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

Reset Push Badge

Hi Doug,

Instead of prepushNotification.setApplicationIconBadgeNumber(0);/preTry using this code:prepushNotification.setApplicationIconBadgeNumber(successHandler, 0);/preWhere codesuccessHandler/code is a function that should run when you set value (can be empty and do nothing).

Nate Kahl
Posts: 0
Joined: Fri May 17, 2013 7:03 pm

Reset Push Badge

Could you please elaborate on the successHandler function? I haven't been able to get the badge to reset to 0

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Reset Push Badge

Hi Nate -

Please provide more information about your issue. What exactly have you tried? And what and where is not working?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Reset Push Badge

Hi Nate,

What event do you use for this code?

Nate Kahl
Posts: 0
Joined: Fri May 17, 2013 7:03 pm

Reset Push Badge

on DeviceReady I run:
var pushNotification = window.plugins.pushNotification;
pushNotification.setApplicationIconBadgeNumber(successHandler, 0);

but nothing happens to the badge

Return to “Issues”