ios 如何添加对“”支持?“(查询)在apple-app-site-association文件的路径中?

ikfrs5lh  于 2023-06-25  发布在  iOS
关注(0)|答案(2)|浏览(187)

“apple-app-site-association”文件内容:

{

    "appclips": {
        "apps": ["**********.com.project.example.Clip"]
    },
    "applinks": {
        "apps": ["**********.com.project.example"],
        "details": [
          {
            "appID": "**********.com.project.example",
            "paths": [ "/event/*", "/ticket?v=*" ]
          }
        ]
    }
}

文件已设置在“https://< fully qualified domain>/.well-known/apple-app-site-association”
我面临的问题是它是为
“https://< fully qualified domain>/event/EVENT-ID”,
但它并没有调用应用程序
“https://< fully qualified domain>/ticket?v=VOLUME-ID”
是因为“?还是我错过了什么

qxgroojn

qxgroojn1#

我们需要使用组件数组

"components": [  
     {
         "/": "/help/*",
         "?": { "articleNumber": "????" },
         "comment": "blah blah"
     }
 ]

请参阅https://developer.apple.com/documentation/xcode/supporting-associated-domains

bihw5rsg

bihw5rsg2#

最终实施了这个解决方案:
使用“组件”代替“路径”

{
  "appclips": {
    "apps": [
      "**********.com.project.example.Clip"
    ]
  },
  "applinks": {
    "apps": [
      "**********.com.project.example"
    ],
    "details": [
      {
        "appID": "**********.com.project.example",
        "components": [
          {
            "/": "/event/*",
            "comment": "(www.example.com/event/EVENTID) Matches any URL with a path that starts with /event/."
          },
          {
            "/": "/ticket",
            "?": {
              "v": "???????"
            },
            "comment": "(www.example.com/ticket?v=QWERTYU) Matches any URL with a path that has a query item with name 'v' and a value of exactly seven characters."
          },
          {
            "?": {
              "L": "??????????"
            },
            "comment": "(www.example.com?L=QWERTYUIOP) Matches any URL with a path that has a query item with a value of exactly ten characters."
          }
        ]
      }
    ]
  }
}

注意事项:
1.检查deepLinking时,请等待一段时间,因为更新AASA文件内容后需要时间来反映更改。苹果文档资源

  1. iOS将在首次安装应用以及从App Store安装更新时下载AASA,但不会更频繁地刷新。如果您希望在AASA中更改生产应用的路径,则需要通过App Store发布完整更新,以便所有用户的应用重新获取您的AASA并识别新路径。参考文献

相关问题