iOS - Bug With Universal Links

做~自己de王妃 提交于 2019-12-03 03:21:50

问题


I have setup Universal Links in my iOS app exactly to details following the steps outlined here:

How to Set Up Universal Links

It validates 100% successfully using both Branch and Apple validators. But now that I'm trying to test out the finished product, I'm having trouble.

If I type in or tap a link to my site (ex, www.mydomain.com), Safari/Chrome/Facebook goes right to my website.

However, if I go to Google, type www.mydomain.com in as the search, locate the link to my site and long press on the link, 'Open in MyApp' is one of the options and works perfectly.

Why is this? I'm pulling out my hair!


回答1:


Universal Links unfortunately don't work everywhere. From this page:

  • Messages | works
  • Mail | works
  • Whatsapp | works
  • Slack | works, if it's set to open Safari, not in-app browser (uses SFSafariViewController)
  • Safari | works conditionally
  • Chrome | works conditionally
  • Google | works conditionally
  • Gmail | if Chrome installed, opens link in Chrome (not Universal Link). Else, works conditionally
  • Inbox | if Chrome installed, opens link in Chrome (not Universal Link). Else, works.
  • Twitter | works conditionally
  • Facebook | works conditionally
  • FB Messenger | works conditionally
  • WeChat | works conditionally
  • Pinterest | not working
  • Telegram | not working (uses SFSafariViewController)

Note: Conditionally working means that it works (i.e., opens the app) some of the time:

  • Universal Links will not work if you paste the link into the browser URL field.
  • Universal Links work with a user driven <a href="..."> element click across domains. Example: if there is a Universal Link on google.com pointing to bnc.lt, it will open the app.
  • Universal Links will not work with a user driven <a href="..."> element click on the same domain. Example: if there is a Universal Link on google.com pointing to a different Universal Link on google.com, it will not open the app.
  • Universal Links cannot be triggered via Javascript (in window.onload or via a .click() call on an <a> element), unless it is part of a user action.
  • Google, Gmail, Inbox, Twitter, Facebook, FB Messenger, WeChat -- Universal Links only work when you have a webview already open. In other words, they do not work in-app from the feed / main views. Again, they also must be cross-domain, aka if your user is on yourapp.com and clicks a Universal Link also for yourapp.com, it will not work. However, clicking from yourapp.com to bnc.lt will trigger the link to function as a Universal Link and open your app directly.


来源:https://stackoverflow.com/questions/37369596/ios-bug-with-universal-links

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