如何识别 "路径 "数组中通用链接 "苹果应用网站关联 "文件中的 "www.domainname.com?v="

问题描述 投票:-1回答:1
{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "47BSW6D45T.com.acno.AppBundleId",
        "paths": [
          "/?v=*", "/v=*", "/*v=*"
        ]
      }
    ]
  }
}

我试过的路径,是写在路径阵列,但没有打开我的网址从消息或邮件或从safari的

ios swift ios-universal-links
1个回答
0
投票

年纪越大 paths 元素,iOS 12 及更早版本的网站关联文件只检查 url 的路径。

文件:

请注意,只有URL的路径部分被用于比较,其他部分,如查询字符串或片段标识符被忽略。其他组件,如查询字符串或片段标识符,将被忽略。

如果您只想让您的应用程序处理具有特定查询字符串的urls,那么您需要在应用程序收到URL后检查它的查询字符串。

如果查询字符串不符合您的要求,那么您可以将URL传递给 openURL 以便在Safari中打开它。

在iOS 13中, components 在您的站点关联文件中的键可以指定一个查询字符串匹配。

{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "47BSW6D45T.com.acno.AppBundleId",
        "paths": [
          "*"
        ],
        "appIDs": ["47BSW6D45T.com.acno.AppBundleId"],
        "components":[
           {
              "/": "*",
              "?": { "v": "*" },
              "comment": "Matches any URL whose path starts with / and which has a query item with name 'v'"
           }
      }
    ]
  }
}
© www.soinside.com 2019 - 2024. All rights reserved.