SYIOS-202: IOS should no longer reset badge count on launch

This commit is contained in:
giomfo
2016-02-26 12:27:22 +01:00
parent d2da88a729
commit 7611fc12a2
+16 -15
View File
@@ -270,7 +270,7 @@
NSLog(@"[AppDelegate] didFinishLaunchingWithOptions: clear the notifications");
// clear the notifications counter
[self clearNotifications];
// [self clearNotifications];
}
return YES;
@@ -338,7 +338,7 @@
}
// clear the notifications counter
[self clearNotifications];
// [self clearNotifications];
// cancel any background sync before resuming
// i.e. warn IOS that there is no new data with any received push.
@@ -352,8 +352,9 @@
NSLog(@"[AppDelegate] applicationWillEnterForeground");
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
// clear the notifications counter
[self clearNotifications];
// [self clearNotifications];
_isAppForeground = YES;
}
@@ -642,18 +643,18 @@
completionHandler(UIBackgroundFetchResultNoData);
}
- (void)clearNotifications
{
NSLog(@"[AppDelegate] clearNotifications");
// force to clear the notification center
// switching from 0 -> 1 -> 0 seems forcing the notifications center to refresh
// so resetting it does not clear the notifications center.
[UIApplication sharedApplication].applicationIconBadgeNumber = 1;
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
[[UIApplication sharedApplication] cancelAllLocalNotifications];
}
//- (void)clearNotifications
//{
// NSLog(@"[AppDelegate] clearNotifications");
//
// // force to clear the notification center
// // switching from 0 -> 1 -> 0 seems forcing the notifications center to refresh
// // so resetting it does not clear the notifications center.
// [UIApplication sharedApplication].applicationIconBadgeNumber = 1;
// [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
//
// [[UIApplication sharedApplication] cancelAllLocalNotifications];
//}
#pragma mark - Matrix sessions handling