Universal Link在Safari中不起作用 [英] Universal Link does not work in Safari

查看:609
本文介绍了Universal Link在Safari中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的应用中实现了google登录.问题是当我使用Safari登录时,我希望用户被重定向回我的应用.

我尝试的第一种方法是使用自定义URL方案.这项工作可行,但是会向用户显示一个弹出窗口,提示您是否要打开(app name).

看来,此弹出窗口的解决方案是我已实现的通用链接.现在,我可以从Notes和其他应用程序无缝导航到我的应用程序.但是,当我在我的应用程序中尝试此操作时,它不起作用,并且用户被重定向到网站而不是应用程序.

为了进行测试,我创建了一个网站并在其中添加了一个按钮,该按钮已链接到我的原始网站.当我在Safari中打开该网站并单击按钮时,我的应用程序将打开.那么,为什么从Google登录到我的网站的重定向无法打开我的应用?

解决方案

通用链接与自动重定向一起使用.必须通过某种用户操作来触发它们.链接URL还必须与单击链接的页面位于不同的域/子域中(例如example.domlink.example.com).

根据对Notes和其他应用程序中链接行为的描述,您的配置似乎正确,并且您只是在尝试做Universal Links不支持的操作.

对于其他通过Google查找此问题并且没有Notes链接正常工作的人,请尝试 Branch.io 中的Universal Links验证器工具(完整披露:我在分支团队中). /p>

I have implemented google sign-in in my app. The problem is when I go to Safari for the sign in I want the user to be redirected back to my app.

The first approach that I tried was using Custom URL scheme. This worked, however the user was shown a pop-up saying 'Do you want to open (app name)'.

It appears the solution to this pop-up is Universal Links, which I have implemented. I can seamlessly now navigate to my app from Notes and other apps. However, when I tried this inside my app, it doesn't work and the user is redirected to the website instead of the app.

For testing, I created a website and added a button to it, which was linked to my original website. When I open that website in Safari and click the button, my app opens. So why doesn't the redirection from google sign-in to my website open my app?

解决方案

Universal Links do not work with automatic redirects. They must be triggered via some sort of user action. The link URL also needs to be on a different domain/subdomain from the page where the link is being clicked (e.g., example.dom and link.example.com).

Based on your description of link behavior from Notes and other apps, it appears your configuration is correct and you are simply attempting to do something that Universal Links does not support.

For others who find this question via Google and do not have links from Notes working correctly, try the Universal Links validator tool from Branch.io (full disclosure: I'm on the Branch team).

这篇关于Universal Link在Safari中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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