3

My app needs to be able to open a custom type of files from an email. Everything worked at first, but I noticed at some point that it's not working anymore in case of trying to open the file while the app is in the background, but still works fine when app is not running.

I'm trying to get the URL of the file from the AppDelegate method -application:openURL:options: which is never called.

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
    NSLog(@"Open URL fired !");
    [self handleURL:url];
}

Since it's works when the app is closed, I'm pretty sure the custom file type is correctly set.

Anyone having a suggestion ?

Thanks

  • Looks like there is a lot of overlap with [this SO question](https://stackoverflow.com/questions/33034771/launch-app-using-url-but-openurl-not-called). They seem to have the opposite problem, but a number of solutions are mentioned regarding handling calls in the background. – theeagle Jan 29 '18 at 12:48
  • @theeagle : I already looked a lot of similar topics with the reverse problem which has mostly two main causes : - The AppDelegate method used was the deprecated ones (which is not my case) - The URL should be retrieved from application:didFinishLaunchingWithOptions:, which is not call again for background openURL. –  Jan 30 '18 at 15:05

0 Answers0