Reputation: 1646
I am setting 0 application icon badge number, as below as opening app.
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
but as server sends increment while app is in background of killed state, it never again starts with ZERO.
Say, if it is 2, than will be 3, than will be 4 on every push. If I open App and set it ZERO, and go back, it shows nothing on iCON, but as server sends, it starts from 5.
In short, it keeps existing counter.
How can I fix this issue. I have iOS 10.1, and Xcode 8.1
Thanks.
Upvotes: 0
Views: 146
Reputation: 969
The payload that comes from server already has a badge number that will be setted, so no matter what it was previously. Only badge number that you get in payload matters.
What you need to do is add some custom logic to the place where you call [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
so you can reset server badge count each time you activate the app.
Upvotes: 1