From c61146b22db227a57364812baf3fa9cf94f3a976 Mon Sep 17 00:00:00 2001 From: Giom Foret Date: Fri, 24 Nov 2017 17:16:47 +0100 Subject: [PATCH] Should fix spontaneous logout --- Riot/AppDelegate.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 09485157b..cf0b98653 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -312,6 +312,14 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN - (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(nullable NSDictionary *)launchOptions { + // Check whether the content protection is active before going further. + // Should fix the spontaneous logout. + while(![application isProtectedDataAvailable]) + { + NSLog(@"[AppDelegate] willFinishLaunchingWithOptions: wait for protected data"); + [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.5f]]; + } + // Set the App Group identifier. MXSDKOptions *sdkOptions = [MXSDKOptions sharedInstance]; sdkOptions.applicationGroupIdentifier = @"group.im.vector";