mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-20 22:52:12 +02:00
SYIOS-202: IOS should no longer reset badge count on launch.
This commit is contained in:
+11
-27
@@ -265,13 +265,6 @@
|
||||
|
||||
NSLog(@"[AppDelegate] didFinishLaunchingWithOptions: the application is launched in background");
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"[AppDelegate] didFinishLaunchingWithOptions: clear the notifications");
|
||||
|
||||
// clear the notifications counter
|
||||
// [self clearNotifications];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
@@ -337,12 +330,8 @@
|
||||
[account pauseInBackgroundTask];
|
||||
}
|
||||
|
||||
// clear the notifications counter
|
||||
// [self clearNotifications];
|
||||
|
||||
// cancel any background sync before resuming
|
||||
// i.e. warn IOS that there is no new data with any received push.
|
||||
[self cancelBackgroundSync];
|
||||
// Refresh the notifications counter
|
||||
[self refreshApplicationIconBadgeNumber];
|
||||
|
||||
_isAppForeground = NO;
|
||||
}
|
||||
@@ -353,8 +342,9 @@
|
||||
|
||||
// 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];
|
||||
// cancel any background sync before resuming
|
||||
// i.e. warn IOS that there is no new data with any received push.
|
||||
[self cancelBackgroundSync];
|
||||
|
||||
_isAppForeground = YES;
|
||||
}
|
||||
@@ -643,18 +633,12 @@
|
||||
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)refreshApplicationIconBadgeNumber
|
||||
{
|
||||
NSLog(@"[AppDelegate] refreshApplicationIconBadgeNumber");
|
||||
|
||||
[UIApplication sharedApplication].applicationIconBadgeNumber = [MXKRoomDataSourceManager notificationCount];
|
||||
}
|
||||
|
||||
#pragma mark - Matrix sessions handling
|
||||
|
||||
|
||||
@@ -59,10 +59,10 @@
|
||||
}
|
||||
|
||||
// Notify unreads and bing
|
||||
if (roomCellData.unreadCount)
|
||||
if (roomCellData.hasUnread)
|
||||
{
|
||||
self.bingIndicator.hidden = NO;
|
||||
if (0 < roomCellData.unreadBingCount)
|
||||
if (0 < roomCellData.highlightCount)
|
||||
{
|
||||
self.bingIndicator.backgroundColor = roomCellData.recentsDataSource.eventFormatter.bingTextColor;
|
||||
self.lastEventDate.textColor = self.bingIndicator.backgroundColor;
|
||||
|
||||
Reference in New Issue
Block a user