How can I launch back the app that opened my custom URL scheme?

后端 未结 1 2009
自闭症患者
自闭症患者 2021-01-13 07:29

I\'m working on an app that manages my own URL scheme so I implement the callback:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOpt         


        
相关标签:
1条回答
  • 2021-01-13 08:09

    The only way would be to have both apps each support a custom URL scheme. Then you embed the caller URL in the URL of the other app.

    For example, let's say App2 wants to call App1 in a way so that App1 could then "call back" to App2. It would create and open an URL like this:

    app1://?caller=app2%3A%2F%2Fblabla
    

    When you decode the caller part you would get back the string app2://blabla which you could then again open with openURL: to "call back".

    0 讨论(0)
提交回复
热议问题