Universal Link does not work in Safari

与世无争的帅哥 提交于 2019-12-05 04:37:20

问题


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?


回答1:


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).



来源:https://stackoverflow.com/questions/44706216/universal-link-does-not-work-in-safari

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!