Ben Leffler
Ben Leffler

Reputation: 1

Universal Links not triggering on iOS across subdomains

We are currently attempting to implement Universal Links in order to navigate users between our core iOS apps but have recently hit a brick wall that has me quite stumped.

App 1 is an iOS app that presents a WebView based dashboard to the user with content delivered from a subdomain (eg. https://dashboard.domain.com/)

When the user taps a button from within the web content in the dashboard the app makes a url request out to another subdomain and path (eg. https://breakout.domain.com/go?foo=bar)

This url is registered as a universal link and should open the target iOS app - App 2. The problem is that it ends up opening the device browser and attempts to load the url instead.

We have an apple-app-site-association file hosted at https://breakout.domain.com/.well-known/ and have correctly declared the path and app specific information within, as well as registering the applinks:breakout.domain.com domain in App 2's entitlements.

Furthermore we know that our implementation and configuration is sound as we can reliably trigger that universal link url (opening App 2) through other testable means.

However when the universal link request initiator originates from App 1's WebView mentioned in the second paragraph above - iOS fails to intercept the url request and treats it as it would any other web link.

My first thought was that iOS was treating the initiator domain as being the same as the universal link domain.

However Apple documentation here would indicate that using subdomains should satisfy the rule where the network request must not originate from within the same domain as the universal link in order to trigger the interception and open the target app.

So to test this we changed the button on the dashboard to call to a new universal link operating out of a different top level domain (eg. https://breakout.new-domain.com/go?foo=bar) and whaddya know - it worked. App 2 opened up successfully.

So I guess my question is, has anybody else come across this particular issue before? I am very keen to know of a workaround (if one exists) that doesn't require us to use a unique top level domain just to serve the functionality of a universal link between App 1 and App 2.

Upvotes: 0

Views: 63

Answers (1)

Ben Leffler
Ben Leffler

Reputation: 1

So it turns out that the issue was unrelated to the underlying same-domain ruleset that governs link interception within iOS.

In App 1 we run a domain whitelist to allow only certain urls to open within its WebView. The urls that do not validate against the whitelist get booted out to the device browser to open.

It seems that we had the top level domain (and any subdomains) whitelisted and that was interfering with the universal link interception process.

Ensuring that the https://breakout.domain.com was not whitelisted for viewing within the app solved the problem and universal links are now getting picked up by the device. Winner winner chicken dinner.

Upvotes: 0

Related Questions