mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-09 09:27:42 +02:00
Merge pull request #1561 from vector-im/kill_in_bg
A possible patch to avoid the app being killed in background on iOS11
This commit is contained in:
+11
-3
@@ -1053,9 +1053,17 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
|
||||
}
|
||||
}
|
||||
|
||||
NSLog(@"[AppDelegate] didReceiveRemoteNotification: BEFORE completionHandler");
|
||||
completionHandler(UIBackgroundFetchResultNoData);
|
||||
NSLog(@"[AppDelegate] didReceiveRemoteNotification: AFTER completionHandler");
|
||||
// Possible workaround for https://github.com/vector-im/riot-ios/issues/1522
|
||||
// iOS 11 ignores us when we say that we will not display a local notification
|
||||
// making the app crash in background.
|
||||
// So, try to send the information a bit later with a dispatch_async :/
|
||||
NSLog(@"[AppDelegate] didReceiveRemoteNotification: BEFORE completionHandler #1");
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
NSLog(@"[AppDelegate] didReceiveRemoteNotification: BEFORE completionHandler #2");
|
||||
completionHandler(UIBackgroundFetchResultNoData);
|
||||
NSLog(@"[AppDelegate] didReceiveRemoteNotification: AFTER completionHandler");
|
||||
});
|
||||
}
|
||||
|
||||
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
|
||||
|
||||
Reference in New Issue
Block a user