iOS 深度链接(通用链接)通过子域

标签 ios iphone ssl deep-linking ios-universal-links

我已经阅读了很多关于通用链接的文章,但我仍然需要弄清楚一些事情。

我必须添加到 http://www.domain.com 的通用链接,但由于某些原因,我将无法使我的网站通过 SSL 认证,甚至无法将 apple-app-site -与根文件夹中的 https 关联。所以我想用不同的方式来做这件事,我将把 apple-app-site-association 文件放在子域的根目录中,比如说 https://www.app.domain .com/apple-app-site-association

然后,只要通用链接可用,我就会打开该子域的每个通用链接,并将 https://www.app.domain.com 重定向到 http://www.domain。 com 如果通用链接不可用。

Questions in my mind :-
  1. apple says - file needs to be accessible via HTTPS—without any redirects—at https:///apple-app-site-association. In this line what does apple mean by without any redirects ?

  2. when apple does not find any universal link related to a particular URL, will it itself redirects it to safari.

  3. Is this a safe way to add universal links or is it necessary to have our main domain on https or at-least apple-app-site-association on https

最佳答案

这应该可以正常工作。要明确回答您的问题:

  1. “无重定向”意味着当 iOS 请求 https://www.app.domain.com/apple-app-site-association 时,它必须在该地址找到文件。您不能有任何类型的重定向(Javascript、301、302 等)
  2. 如果 URL 对于通用链接无效,因为您没有使用 apple-app-site-association 文件中的包含规则覆盖它,它将使用 Safari 打开。如果 URL 位于另一个没有有效 apple-app-site-association 文件的域(例如,http://www.domain.com/),那么它将也可以在 Safari 中打开。
  3. 是的,很好。绝对是一种解决方法,但并非不安全。

您还应该调查托管的深度链接服务,例如 Branch.io (完全披露:我在 Branch 团队)或 Firebase 动态链接。这些将为您提供所有相同的好处(老实说,还有更多的灵 active ),而无需任何设置麻烦。

关于iOS 深度链接(通用链接)通过子域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41115860/

相关文章:

ios - 呈现 UISplitViewController 的主视图和细节 View

ios - 如果编程语言发生变化,如何更新 iOS 应用商店中的应用?

iphone - 如何禁用 rightBarButtonItem

c++ - 写入套接字接收的进程字符串的输入

Java 7 ssl 握手在 Java 6 上运行时失败

ios - 关闭呈现 View Controller

ios 8 键盘扩展设置包

iphone - UITableView索引放大镜字符是什么?

iphone - Cocos2d安装

java - PKIX 路径验证失败 : Path does not chain with any of the trust anchors using a proxy