iOS通用,仅1个路径段

iOS通用,仅1个路径段,ios,ios-universal-links,Ios,Ios Universal Links,我想为通用链接创建一个路径,该路径仅在有1个文件夹段时有效。比如: https://example.com/first or https://example.com/first/ 但我不希望它进入我的应用程序时,URL是: https://example.com/first/second https://example.com/first/index.html https://example.com/first/second/script.js https://example.com/firs

我想为通用链接创建一个路径,该路径仅在有1个文件夹段时有效。比如:

https://example.com/first or https://example.com/first/
但我不希望它进入我的应用程序时,URL是:

https://example.com/first/second
https://example.com/first/index.html
https://example.com/first/second/script.js
https://example.com/first/second/third/image.png
我使用的是AASA JSON

"appID": "<appid>",
"paths": [ 
  "*/*.aspx",
  "NOT /first/*/*",
  "/first/*/"
]
“appID”:“,
“路径”:[
“*/*.aspx”,
“不是/第一个/*/*”,
“/first/*/”
]

它不起作用。如何通过路径段的数量来控制它?

使用
*
的问题是,您将包括任何字符串组合,包括空字符串。我建议尝试添加一个
字符,后跟一个
*
,以确保字符串不能为空。在您的情况下,请尝试:

"appID": "<appid>",
"paths": [ 
   "*/*.aspx",
   "/?*", //Include paths that have '/first/'
   "NOT /?*/?*" //For paths that have '/first/second/third' etc
]
“appID”:“,
“路径”:[
“*/*.aspx”,
“/?*”,//包括具有“/first/”的路径
“NOT/?*/?*”//用于具有“/first/second/third”等的路径
]
希望这对你有用