I currently have an application that receives the correct badge number via push notification. The backend server keeps track of the number of unread updates and sends the number in a push notification when an event happens. The application badge number is then automatically set. When the user clicks on a specific part of the application the badge count is decremented and synched with the backend. This should all work in theory. However, I can't seem to make the badge stay after the user opens the application after receiving the initial push. How do I make the number stay, I looked into the issue and solving it using local notifications with the information located here: iOS badge number live update but I am hoping to use a simpler solution. Thanks for the help!
Asked
Active
Viewed 1,474 times
2 Answers
3
In your application delegate, do you have any code that is clearing the badge count i.e.
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
||
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];

CW0007007
- 5,681
- 4
- 26
- 31
-
Thanks for the quick response it turned out I did, really stupid mistake on my part thanks for the help! – ScottOBot Jan 29 '14 at 14:58
-
No problems. Mark it as the answer so others know what to look for. – CW0007007 Jan 29 '14 at 14:59
-
1will do in about 6 minutes :P – ScottOBot Jan 29 '14 at 14:59
0
In my case, it was because I was using Airship's SDK and instead of using their code for updating the badge count, I was using the iOS native code and that caused a glitch, especially right after a reinstallation and grant the push perms again.
Also, they have a reset method so if you are using them or any other library and that library has such capability, I would strongly advise against manually touching iOS push delegates, setting badge count number the classic way, etc. and seek to use the SDK's implementation instead.

Amir Hajiha
- 836
- 8
- 20