Launch App using URL, but OpenUrl Not Called

后端 未结 8 1400
长发绾君心
长发绾君心 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

    Hi when the app is not launched before, the method "handleOpenURL" is never called. You have to check "launchOptions" in didFinishLaunchingWithOptions for object with key "UIApplicationLaunchOptionsURLKey"

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    NSURL *url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
    //call function to handle the url like in handleURL, but do not call handleURL directly
    
    }
    

提交回复
热议问题