首页 > 解决方案 > 如何使用与组件参数完全匹配的 apple-app-site-association 文件?

问题描述

我正在尝试编写一个组件匹配,其中我只匹配 apple-app-site-association 文件中 URL 的 quesid=2109061920 参数。我希望所有这些过滤都在 apple-app-site-association 文件中完成,而不是在 swift 移动代码库中。

测试网址: https ://example.org/MyChart/inside.asp?mode=questionnaire&from=list&src=sys&srcid=1&quesid=2109061920&empPIN=xxxxx%3D%3D&mobile=1

这有点起作用,这意味着它只过滤带有 quesid 的项目,但我可以在它之后放置任何内容,例如 quesid=2109061920 777 ...所以它不是完全匹配

{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appIDs": [
          "***.com.***"
        ],
        "components": [
          {
            "?": {
              "quesid": "2109061920"
            },
            "comment": "testing"
          }
        ]
      }
    ]
  }
}

这也不起作用:

{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appIDs": [
          "***.com.***"
        ],
        "components": [
          {
            "/": "/MyChart/*",
            "?": "quesid=2109061920",
            "comment": "testing"
          }
        ]
      }
    ]
  }
}

关于我所缺少的任何想法?

标签: iosswiftmobile

解决方案


您可以创建一个json文件来匹配精确的查询参数,如下所示:

{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appIDs": [
          "***.com.***"
        ],
        "components": [
          {
            "/": "/MyChart/*",
            "?": { "quesid": "2109061920" },
            "comment": "testing"
          }
        ]
      }
    ]
  }
}

推荐阅读