简体   繁体   中英

iOS Universal links : Tapping universal link inside the Application redirects me to safari instead of continuing in the application

I am using third party SDK which internally calls UIApplication.shared.OpenUrl to open a universal link within the application.

But instead of getting call-back in application:(UIApplication *)application continueUserActivity the link is opened in Safari.

I want to continue handling the Universal link within the application, rather than move to Safari.

Note: I cannot use Custom URL scheme due to project restrictions. When I use iPhone Notes application that universal link; tapping on the link opens my application.

https://frozen-garden-86689.herokuapp.com/apple-app-site-association

You have to add associated domains in your app and upload a file on your website on this path

https://yourwebsite.com/.well-known/apple-app-site-association

in apple-app-site-association you have to add exact this JSON

{
    "applinks": {
        "apps": [],
        "details": [{
            "appID": "xxxxxx", // your appID here like 2u19IxOp1.com.mybudleid.app
            "paths": ["/g/*"] //it should be same
        }]
    }
}

after putting exact JSON on the path, hit the path on the browser it should show this JSON file

important!* and must add the associated domain in your Xcode project which will be applinks:yourwebsite.com

and here your links will start redirecting to your app instead of safari

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM