0

I have implemented Universal links in iOS app. It works perfectly when I put the url in external app such as "Notes" and then tap it. It opens the app.

What I want to achieve is that when someone visits a specific url of my webpage, the ios app should be launched by itself. So in order to accomplish this, I have put:

applinks:www.mydomain.com

in my entitlements.

And the following in my "apple-app-site-association" file

{
"applinks":
{
    "apps": [ ],
    "details":
    [
        {
            "appID": "team_id.com.teamname.app_name",
            "paths": ["/path-CompA/path-CompB/"]
        }
    ]
}

}

But When I navigate through my website, and I reach the path mentioned in json file, it only shows the bar at top of web page saying "Open in App_name" with "Open" button on right side.

I want to know if its the default behaviour of Universal links to not open the app if user is coming from the same domain? If its not the case then how does it open the app form "Notes".

Please note that my json file is not signed but I have put it on my website which is on https.

Thanks,

shujaat
  • 383
  • 4
  • 19
  • When I navigate through the website and reach the path where I need to open the app, it doesn't. It only shows a banner at top to open it. But it opens when I open that link directly by entering the url. – shujaat Dec 07 '15 at 05:49

1 Answers1

0

A couple of things. Can you try changing your apple-app-site-association file code as such?

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "team_id.com.teamname.app_name",
                "paths": [
                "*",
                "/"
                ]
            }
        ]
    }
}

You can check your format with this validation tool: https://search.developer.apple.com/appsearch-validation-tool/

The answer is that basically, this behavior is expected as of iOS9.2, with Universal links. Universal links only work from a different domain.

With Branch (https://branch.io/), you can use one domain for links (bnc.lt), so that when you (as a developer using branch) host universal links on your site, they still operate as expected.

Also, for universal links from other domains (not to the same domain), you can 'unbreak' the safari redirect behavior by long-pressing on the link from an application and choosing 'Open in «App»'. I hope this helps!

jeanmw
  • 446
  • 2
  • 17
  • Can you give more information on "Universal links only work from a different domain." So it is not possible to handle the home page of example.com in Safari and a path like example.com/foo as a universal link? – Christoph Mar 10 '16 at 09:41
  • Hi @Christoph - yes exactly, you cannot Universally link from within the same domain. For example, if you are on the domain yourdomain.com and click a Universal Link also for yourdomain.com, it will not work. However, clicking from yourdomain.com to a different domain will trigger the link to function as a Universal Link and open your app directly (provided Universal Links are enabled for the domain). Hope that clarifies – jeanmw Mar 11 '16 at 23:52