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

Viewed 690

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

1 Answers

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

Related