We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2d4acf commit 5c40c61Copy full SHA for 5c40c61
iOS_SDK/OneSignalSDK/OneSignalNotifications/OSNotificationsManager.m
@@ -764,8 +764,11 @@ + (BOOL)clearBadgeCount:(BOOL)fromNotifOpened {
764
else
765
_disableBadgeClearing = NO;
766
767
- if (_disableBadgeClearing)
+ if (_disableBadgeClearing) {
768
+ // The customer could have manually changed the badge value. We must ensure our cached value will match the current state.
769
+ [OneSignalUserDefaults.initShared saveIntegerForKey:ONESIGNAL_BADGE_KEY withValue:[UIApplication sharedApplication].applicationIconBadgeNumber];
770
return false;
771
+ }
772
773
bool wasBadgeSet = [UIApplication sharedApplication].applicationIconBadgeNumber > 0;
774
0 commit comments