Reputation: 123
Short Question: If the Universal Link is triggered from a domain that is not the parent or sub-domain, essentially a completely different domain than where it is hosted, will it open the app?
Consider a scenario where the AASA file is correctly configured and hosted at https://example1.com/.well-known/apple-app-site-association, and the associated Universal Link is https://example1.com/path.
Now, suppose I am on a domain, https://example2.com, which is neither a subdomain nor the parent domain of https://example1.com. If there is a button on this domain with a Universal Link pointing to https://example1.com/path, will it open the app?
I am aware that a Universal Link won't open if triggered from the same domain where it is hosted, as mentioned in the Apple documentation here: https://developer.apple.com/documentation/technotes/tn3155-debugging-universal-links#Use-universal-links-on-your-site
To use a universal link to open your app while already browsing in Safari, use a different subdomain.
Following is stated in this link: https://developer.apple.com/documentation/xcode/allowing-apps-and-websites-to-link-to-your-content
"When a user browses your website in Safari and taps a universal link in the same domain, the system opens that link in Safari, respecting the user’s most likely intent to continue within the browser. If the user taps a universal link in a different domain, the system opens the link in your app.
Given this guidance, what would be the expected behavior if the Universal Link is triggered from a domain that is not the parent domain, essentially a completely different domain? Will it work as intended?
Upvotes: 0
Views: 587
Reputation: 438092
You asked:
what would be the expected behavior if the Universal Link is triggered from a domain that is not the parent domain, essentially a completely different domain? Will it work as intended?
Yep. As you mentioned in that second reference:
If the user taps a universal link in a different domain, the system opens the link in your app.
Do not get confused by that other reference about subdomains. They’re just warning you that universal links won’t fire up your app if the user is navigating from a web page within the same domain as your AASA. They’re saying that if you want to enjoy the universal link integration with your app while the user is browsing your website, you’d have to use subdomains.
But, they’re not qualifying the universal link behaviors we enjoy from completely different domains. They are just warning you about the limitations when a user clicks on universal links present on your own website.
Upvotes: 0