Update app icon badge number on each received push notification

This commit is contained in:
Denis Morozov 2017-08-22 10:48:59 +03:00
parent 88e9ebddb2
commit 7db33e6a47

View file

@ -43,6 +43,8 @@
#import "CallViewController.h"
#import "MXSession+Riot.h"
//#define MX_CALL_STACK_OPENWEBRTC
#ifdef MX_CALL_STACK_OPENWEBRTC
#import <MatrixOpenWebRTCWrapper/MatrixOpenWebRTCWrapper.h>
@ -1052,6 +1054,9 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
[[UIApplication sharedApplication] scheduleLocalNotification:eventNotification];
}
// Update icon badge number
[UIApplication sharedApplication].applicationIconBadgeNumber = [session riot_missedDiscussionsCount];
dispatch_block_t completionBlock = [weakSelf createPushNotificationHandlingStateCleaningBlock];
weakSelf.pushNotificationHandlingCompletionBlock = completionBlock;