How can I prevent PushPlugin from reseting my badge count to 0 after entering the app from the background?
Asked
Active
Viewed 2,107 times
1 Answers
3
I just came across this problem as well.
For some reason this is intended behaviour. It's because in the com.phonegap.plugins.PushPlugin, the badge get cleared to 0 when the app get active again.
I ended up editing the plugin:
In the file "AppDelegate+notification.m", in the method:
"- (void)applicationDidBecomeActive:(UIApplication *)application {"
Change line ~90:
//zero badge
application.applicationIconBadgeNumber = 0;
to:
//zero badge
//application.applicationIconBadgeNumber = 0;
(I just ended up commenting it out).

Lennaert van Dijke
- 138
- 5