Reputation: 2315
I have read a lot of articles regarding universal links but still i need to be clear regarding few things.
I have to add universal links to http://www.domain.com
but due to certain reasons i will not be able to make my website SSL certified or even put apple-app-site-association with https in root folder. So I thought of doing this in a different way, i will put apple-app-site-association
file in the root of a subdomain, lets say https://www.app.domain.com/apple-app-site-association
Then i will open every universal link with that subdomain whenever universal link is available and redirect https://www.app.domain.com
to http://www.domain.com
if universal link is not available.
Questions in my mind :-
apple says - file needs to be accessible via HTTPS—without any redirects—at https:///apple-app-site-association. In this line what does apple mean by without any redirects ?
when apple does not find any universal link related to a particular URL, will it itself redirects it to safari.
- Is this a safe way to add universal links or is it necessary to have our main domain on https or at-least apple-app-site-association on https
Upvotes: 6
Views: 7043
Reputation: 874
We experienced ways where a 302 on iOS works. In general I fully agree that Apple officially does not seem to support any redirect. The following cases have been tested on an iPhone 6 running iOS 11.
Unfortunately you can see that in some cases it does NOT work. As these cases, Apple Mail and Gmail on iOS are very important for most of us here, I think this is a showstopper and you should not use it.
We tested with Adjust links and therefore in cases where the app does not open Adjust opens the AppStore to download the app.
For all Adjust interested: We tested by opening a link https://app.adjust.com/... which has a 302 on the respective Universal link https://XXXXXXX.adj.st/... on which our app listens.
Upvotes: 1
Reputation: 13613
This should work fine. To explicitly answer your questions:
https://www.app.domain.com/apple-app-site-association
, it must find the file at that address. You can't have a redirect of any kind (Javascript, 301, 302, etc)apple-app-site-association
file, it will be opened using Safari. If the URL is on another domain without a valid apple-app-site-association
file (e.g., http://www.domain.com/
), then it will also be opened in Safari.You should also investigate a hosted deep linking service like Branch.io (full disclosure: I'm on the Branch team) or Firebase Dynamic Links. These will give you all of the same benefits (plus a bunch more flexibility, to be honest) without any of the setup headaches.
Upvotes: 5