Launch App using URL, but OpenUrl Not Called

后端 未结 8 1382
长发绾君心
长发绾君心 2020-12-31 00:43

I have implemented a URL Scheme and use it to pass data to my app by calling method. The entire code is shown as below

- (BOOL)application:(UIApplication *)a         


        
8条回答
  •  暖寄归人
    2020-12-31 01:01

    I landed up with the same issue for an app on iOS 13. Even with the proper implementation of - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options method, it never got invoked.

    From iOS13, the SceneDelegates get invoked instead of the AppDelegate method. Once I implemented the

    - (void)scene:(UIScene *)scene openURLContexts:(NSSet *)URLContexts
    

    on the scene delegate, it would work if the app was already in memory. However, for a cold start, I had to implement the call back

    -(void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions
    

    as well.
    While implementing

    -(void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions
    

    please remember to handle cases when the app is not launched from an URL.

    Here is an useful reference: https://forums.developer.apple.com/thread/124132

提交回复
热议问题