Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 9 Universal Links not launching the app from the same domain

I have setup my AASA JSON file to open the app when someone visits myDomain.com/ShowInTheApp/*

This works from Notes App, Email, Gmail App, Gmail web on safari and basically any other websites other myDomain.com .

When myDomain.com/chooseAppORweb.html contains a link to myDomain.com/ShowInTheApp/ , safari always opens it in the same tab, app wont get launched. I can tap and hold the link to show the context menu that contains an entry "Open In [My app name]" which will indeed launch my app. But not by single tapping on the link.

When I do the exact same steps from another domain, NOTmyDomain.com/chooseAppORweb.html always launches the app without issues.

Has anyone succeeded in launching the app consistently from the same domain using UL ?

Also, if there is an Apple's document that explains any of these behaviours, please share the link.

like image 663
Nikhil Mathew Avatar asked Nov 05 '15 21:11

Nikhil Mathew


1 Answers

I'm not sure when Apple added this to their documentation, but it's explained on their Support Universal Links page, in the first note:

In iOS 9 and later, universal links let users open your app when they tap links to your website within WKWebView and UIWebView views and Safari pages, in addition to links that result in a call to openURL:, such as those that occur in Mail, Messages, and other apps.

When a user is browsing your website in Safari and they tap a universal link to a URL in the same domain as the current webpage, iOS respects the user’s most likely intent and opens the link in Safari. If the user taps a universal link to a URL in a different domain, iOS opens the link in your app.

For users who are running versions of iOS earlier than 9.0, tapping a universal link to your website opens the link in Safari.

(Emphasis added)

Essentially, once a user reaches a page hosted on your domain in Safari, any links they follow on your domain will be opened in Safari, even if they're defined as Universal Links by your app.

like image 65
Defragged Avatar answered Oct 07 '22 07:10

Defragged