Reputation: 11053
I need to increase the icon badge number everytime a local notification gets fired to inform the user that there is one more question he needs to answer. When the user answers a question of any sent notification the icon badge number is beeing reduced by 1. I only have one-time notifications, no recurring.
Since the app is not running when the notification fires I do not have any idea how to increase the icon badge number at that time. While there is no problem to decrease the number when the user answers a question - since this is done within the app.
Is there any possibility - maybe similar to registerForRemoteNotificationTypes
for push notifications?
Many thanks!
Upvotes: 1
Views: 1024
Reputation: 15213
The UILocalNotification
class has a property applicationIconBadgeNumber
of type NSInteger
, which you can set, when scheduling the local notification.
Upvotes: 2