Universal Deep Linking with redirects

I was wondering if it was possible to get Universal Deep Linking working with redirects that open up Safari first. I've successfully gotten deep linking to work when doing a normal link to the site, but when it is behind a link that is created by a marketing company, that link opens up Safari first, then opens the mobile web browser and not the app itself.


Is it possible to go from a redirect in Safari to the app?

Accepted Reply

No, Universal Links do not work with redirects. I'd encourage you to file a bug report if that's something you'd want to see.

Replies

I'm in dire need of the same answer.


We've got quite a few marketing campaigns which send out promotional emails through an emailing system, which wraps our site's links inside their own. Obviously tapping these links does not open our app, instead directs the user to web mobile.


However, and here's the funny part, paid search links in google are also wrapped inside a google's own redirect... but they still work. Tapping such a link in Safari works like a charm.


Any ideas?

No, Universal Links do not work with redirects. I'd encourage you to file a bug report if that's something you'd want to see.

This is interesting because the Spring iOS App https://itunes.apple.com/us/app/spring-shop-800+-brands.-free/id899156093?mt=8 actually works with redirects.


Go ahead and install it then open up one of their newsletter links. I tested using http://click.e.shopspring.com/?qs=47ae80027dcbb4832d5ec01fe9f409e9bb1df7b05b536a3dd8ba2f3487dd49634f56c952fa5b731c


I see that they don't actually have universal links setup since there is no app-site-association-file. Thus the destination link https://www.shopspring.com/products/7113667?ref=email%3Abrandnewarrivals- does not actually open the App. But, in the redirect flow Safari prompts "Open this page in 'Spring'".


Any ideas?

filed bug report 23742861 to request universal app links open native Apps if redirected URL matches one found in apple-app-site-association file

My suspicion (although I haven't dug in to verify) is that you're simply seeing JavaScript handling of opening the custom URL at some point. Since the Spring app does not support Universal Links, that's definitely not a part of this picture.

Hm, can you elaborate a little bit on that answer?


After some more testing I have come to realise that everything works smoothly if the redirect occurs within Safari, but not when it starts in a third party app. For instance, opening one of our promotional emails from gmail, mobile-website (in Safari), sends the user directly to our app, even though the universal link is wrapped in our emailing system's own redirect scheme. However, when opening the promotional email from the Mails app, it directs the user to my mobile site instead of the app.

Same goes for paid search links and display campaign links: works when the redirect is started within Safari, does not work when started from a third party app.

Would you be able to share exactly how you have experienced this behaviour?


Our mailer links follow conventional HTTP 300 redirects that eventually lead towards a universal link that the app supports however, Safari never opens the App.


Since @pdm just said "No, Universal Links do not work with redirects. I'd encourage you to file a bug report if that's something you'd want to see." I would love to know how you got around this?

You need look no further than paid search. In paid search, google wraps your site's link in their own redirect mechanisms, optimizer and such. If I tap a paid search link in Safari, it leads directly to our app. However, should I copy and paste that very same link into another app and try to open it from there, it will lead me to our mobile website instead.


Imagine that X is your universal link.

R() is a redirect function.

R(X), then, is your unviersal link wrapped in some redirect scheme.


If you tap X in any app, it leads to your app.

If you tap R(X) in Safari, it leads to your app.

If you tap R(X) in any third party app, it leads to web-mobile.


I would love to have R(X) lead always to our app, no matter the application in which it is executed. Otherwise how are we supposed to bypass any social media/emailing system's own redirects?

We are also facing the same Issue. And this scenario seems to be critical for us. Please let us know if there is any workaround or solution for this.

We also are impacted by this bug. I hope this will be fixed very soon, as there is no workaround for those of us who use tracking in marketing emails.

I'm trying to work with Firebase dynamic links and having the same issue when gmail adds protection to links in email by URL defence (proofpoint product) . This is so frustrating , the same behaviour works seamlessly in Android btw .

I am also facing similar problem. Still I didn't have a solution or explanation why universal links not working for some cases. My app supported to share via facebook, google+ and email.


Facebook ios app, Facebook in Safari can launch my app - work as expected

iOS mail app - work as expexted


Google+ app cannot launch my app. But Google+ in safari can lauch my app. I also want to get a explanation why its not working from google+ app.

Our experience is that if a URL is rewritten the new URL isn't associated with the app and hence it is opened in Safari, not the app. That said, we have developed a workaround for this that is very simple. See: https://stackoverflow.com/a/48198202/8226946

Universal Links do work with redirects for links tapped in an app like the Notes app. If your link, let's say https://example.com/foo, is not a Universal Link but redirects to one and is opened from the Notes app, the user would be routed through Safari first (as in, they can see the Safari redirection occurring). When the links stop redirecting, if the final link is a universal link, then the user will be taken to the app. Redirection is not supported when hosting the AASA file. For example, you cannot host the AASA at https://example.com/.well-known/apple-app-site-association and redirect to also serve it at https://www.example.com/.well-known/apple-app-site-association.