Question

I am a bit (a lot) confused about the Notification Center and the app badge counter. I have designed an iOS to-do app which uses local notifications to alert users of a scheduled reminder (which they set in the app) . The app also uses the icon batch counter to display the # of tasks due "today".

At the time of a set reminder notifications correctly show up in Notification Center. However, once the app has been opened the notifications are cleared from Notification Center. The idea is that the notifications remain available in Notification Center until the user clears them.

I have discussed this with my developer and he states that notifications can only be saved in NC when we do not use the icon batch counter. This seems very illogical to me since the icon batch counter shows the # of tasks due "today" and the notifications shown in Notification Center are alerts set by the user.

Hope you guys can help here.... Thanks!

Was it helpful?

Solution

application can set its own badge (counter) independent of the notification scheduled. so u can surely set whatever counter you want to show the today's task by:

NSUInteger tasksCount = 10; 
[UIApplication sharedApplication].applicationIconBadgeNumber = tasksCount;

talking about the notifications to show in NF bar, it is configurable by user in Device's Native: Settings-> Notifications-> so you cannot force the user to show all notifications in NF bar (lets say 50 for the day) if user has configured for only 5.

Coming back to your concern, when the app is launched, Notifications from NF bar are not automatically wiped off. you have to write the CODE to remove them from inside the app.

[[UIApplication sharedApplication] cancelAllLocalNotifications];

OR

[[UIApplication sharedApplication] cancelLocalNotification:<notification object>];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top