Use UIKit BackgroundTask for handling background tasks in the SDK

This commit is contained in:
manuroe 2017-06-14 17:37:22 +02:00
parent 9a4f5b599e
commit 765be91f0e

View file

@ -50,6 +50,8 @@
#include <MatrixSDK/MXJingleCallStack.h>
#include <MatrixSDK/MXDefaultBackgroundModeHandler.h>
#define CALL_STATUS_BAR_HEIGHT 44
#define MAKE_STRING(x) #x
@ -1358,17 +1360,22 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
{
NSLog(@"[AppDelegate] initMatrixSessions");
MXSDKOptions *sdkOptions = [MXSDKOptions sharedInstance];
// Define the media cache version
[MXSDKOptions sharedInstance].mediaCacheAppVersion = 0;
sdkOptions.mediaCacheAppVersion = 0;
// Enable e2e encryption for newly created MXSession
[MXSDKOptions sharedInstance].enableCryptoWhenStartingMXSession = YES;
sdkOptions.enableCryptoWhenStartingMXSession = YES;
// Disable identicon use
[MXSDKOptions sharedInstance].disableIdenticonUseForUserAvatar = YES;
sdkOptions.disableIdenticonUseForUserAvatar = YES;
// Enable SDK stats upload to GA
[MXSDKOptions sharedInstance].enableGoogleAnalytics = YES;
sdkOptions.enableGoogleAnalytics = YES;
// Use UIKit BackgroundTask for handling background tasks in the SDK
sdkOptions.backgroundModeHandler = [[MXDefaultBackgroundModeHandler alloc] init];
// Disable long press on event in bubble cells
[MXKRoomBubbleTableViewCell disableLongPressGestureOnEvent:YES];