Open iOS app from URL AND Pass Parameters

后端 未结 2 1490
暖寄归人
暖寄归人 2020-12-15 04:30

A link should open the app. I\'ve got that to work. I just want to know how to pass a parameter. Let\'s say the url is \"addappt://?code=abc\". When a view controller pops u

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-15 05:07

    Here is a nice tutorial on Using Custom URL Scheme in iOS

    As in the tutorial, you should parse the URL parameters and store them to use in the app in this method:

    - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
      // Do something with the url here
    }
    

提交回复
热议问题