问题
We have recently begin to encounter issues with our Universal Link implementation when the UL is accessed via a shortened goo.gl
URL.
This Works: https://site.domain.com/Deep/Link
This does not: https://goo .gl/fake
-> 302 Redirect
-> https://site.domain.com/Deep/Link
Is anyone else experiencing the same thing?
Note: I had to break up the shortened Google URL to keep StackOverflow's editor from yelling at me.
回答1:
Universal Links are triggered by the URL that is being accessed, and are ignored if a redirect is not triggered by explicit user action. Since goo.gl
isn't registered to your app (and cannot be, since you don't control it), burying your URL behind a shortened link is bypassing Universal Link detection for the destination domain.
There is no good workaround for this on goo.gl
. The best option is to set up a URL shortener on a custom domain that you CAN register with your app for Universal Links. Alternatively, Branch.io (full disclosure: I'm on the Branch team) or Firebase Dynamic Links could handle this for you, since both essentially set up a custom link shortener on a domain they control for Universal Links on your behalf.
来源:https://stackoverflow.com/questions/36225871/ios-universal-links-and-url-shorteners