toddg toddg - 1 year ago 70
iOS Question

Do Universal Links hit my server?

I've set up Universal Links on my app using an aliased subdomain of my backend with the scheme

applink.mydomain.com
. I want to have users that DON'T have the app installed be redirected to our page in the App Store rather than hitting some nonexistent endpoint on our server (we don't have a webapp only a mobile backend).

I was thinking about doing something like this:

app.get('*', (request, response) => {

const domain = request.headers.host,
subdomain = domain.split('.');

if ( subdomain[0] === 'applink'){
response.redirect('www.linktoappstore.com');
}
...
});


However I don't want this to interfere with the Universal Linking for people who DO have the app installed. Are Universal Link
get
requests sent to my server or does iOS intercept them before that happens?

Answer Source

This should work just fine.

When Universal Links are configured and your app is installed, the device does NOT hit the server before launching the app. This is because iOS caches the apple-app-site-association file when the app is initially installed, and if the URL being opened matches a path defined there, Universal Links kick in. In that situation, iOS completely bypasses any web request and immediately launches your app.

Of course, this means you can't track Universal Link traffic, which can become a major pain point. To work around this, you need something like Branch.io (full disclosure: I'm on the Branch team) to fill in the missing data.

Separately, if you're proxying the subdomain, make sure iOS doesn't see that as any sort of redirect. Otherwise the apple-app-site-association file won't be scraped at all (common Universal Link implementation issue).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download