iOS通用链接和URL缩短器 [英] iOS Universal Links and URL Shorteners

查看:120
本文介绍了iOS通用链接和URL缩短器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当通过缩短的 goo.gl URL访问UL时,我们最近开始遇到我们的Universal Link实施问题。

We have recently begin to encounter issues with our Universal Link implementation when the UL is accessed via a shortened goo.gl URL.

此作品: https://site.domain.com/Deep/Link

这不是: https:// goo .gl / fake - > 302重定向 - > 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?

注意:我不得不拆掉缩短的Google网址,以防止StackOverflow的编辑对我大吼大叫。

Note: I had to break up the shortened Google URL to keep StackOverflow's editor from yelling at me.

推荐答案

通用链接由正在访问的URL触发,如果重定向未由显式用户操作触发,则会被忽略。由于 goo.gl 未在您的应用中注册(并且由于您无法控制它而无法注册),因此将URL隐藏在缩短的链接后会绕过Universal Link检测对于目标域。

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.

goo.gl 上没有好的解决方法。最好的选择是在自定义域上设置URL缩短器,您可以在应用程序中注册Universal Links。或者, Branch.io (完全披露:我在分支团队中)或Firebase动态链接可以为您处理此问题,因为两者都基本上在他们代表您控制Universal Links的域上设置了自定义链接缩短器。

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.

这篇关于iOS通用链接和URL缩短器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆