From 655a02b7695088b9dbaffd3ac9b7b867dcb11cfa Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 30 Nov 2018 00:16:53 +0300 Subject: Fix badge counter and enable background mode for silent notifications --- Juick/AppDelegate.m | 1 + 1 file changed, 1 insertion(+) (limited to 'Juick/AppDelegate.m') diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m index d5d5b9b..950f473 100644 --- a/Juick/AppDelegate.m +++ b/Juick/AppDelegate.m @@ -104,6 +104,7 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { if (userInfo[@"service"]) { + application.applicationIconBadgeNumber = [userInfo[@"user"][@"unreadCount"] integerValue]; [[UNUserNotificationCenter currentNotificationCenter] getDeliveredNotificationsWithCompletionHandler:^(NSArray * _Nonnull notifications) { for (UNNotification* notification in notifications) { if ([notification.request.content.userInfo[@"mid"] integerValue] == [userInfo[@"mid"] integerValue]) { -- cgit v1.2.3