I can't reset my notification badge number for next notification after open previous notification.
Asked
Active
Viewed 2,081 times
-4
-
3Possible duplicate of [Removing badge from iOS app icon](https://stackoverflow.com/questions/9557132/removing-badge-from-ios-app-icon) – Himanth Jul 18 '17 at 12:33
3 Answers
3
Write this code at
-(void)applicationWillEnterForeground:(UIApplication *)application {
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
}

Parvendra Singh
- 965
- 7
- 19
1
Register notification before it calls
UIUserNotificationSettings * notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;

Lal Krishna
- 15,485
- 6
- 64
- 84
0
You can set the badge number from the app itself as follows :
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
By setting the value as 0, you are resetting the badge number
To update the badge number via push, you need to include the following in your payload:
"badge" : 0

Amal T S
- 3,327
- 2
- 24
- 57