iOS Universal Links not working behind Cloudflare

iOS Universal Links not working behind Cloudflare

Support universal links are used for iOS developers so that users can tap a link to the website and get seamlessly redirected to their installed app without going through Safari.

Apple has pretty well-explained documentation on how to setup universal links.

In there it is specified that you should create an apple-app-site-association file on your domain and that file will contain json, but the big BUT is not to have .json extension.

On one of the domains that file when opened through the browser shows the content:

image 7 - iOS Universal Links not working behind Cloudflare

Apple and online tools such as show that the file does not contain valid JSON.

image 8 - iOS Universal Links not working behind Cloudflare

So what is the catch?

When testing with curl I get an error from Cloudflare, and it looks like Cloudflare protection is blocking access to the file:

vvcurl https://shop.XXXXXX.com/apple-app-site-association
image 9 1024x588 - iOS Universal Links not working behind Cloudflare

To confirm this is indeed the case, I bypassed Cloudflare by faking in my hosts file the website to the server IP, and curl gave JSON output:

image 10 - iOS Universal Links not working behind Cloudflare

The solution?

Disable Cloudflare protection or create a rule to exclude this file from the checks.

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.