> opens the app to messages revie-6ren">
gpt4 book ai didi

ios - 在苹果应用程序站点关联文件中,为什么 "NOT"不排除提到的路径?

转载 作者:可可西里 更新时间:2023-11-01 04:23:09 26 4
gpt4 key购买 nike

我已将通用链接添加到我的 iOS 应用程序中

messages http://somesite.com/message/list/ >> opens the app to messages 
review http://somesite.com/review/add/ >> opens the app to review
place http://somesite.com/place/add/ >> opens the app to place
photo http://somesite.com/photo/add/ >> opens the app to photo

一切都按预期工作,我的问题是:如何排除路径或 url,甚至不会打开应用程序?

例如

somepage   http://somesite.com/somepagelink   >> SHOULDN'T OPEN APP, it must show up in the browser.

苹果应用站点关联文件

{
"applinks":
{
"details": [
{
"paths": ["*", "NOT /somepagelink/*"],
"appID": "ID1.myApp"
},
{
"paths": ["*", "NOT /somepagelink/*"],
"appID": "ID2.myApp"
}],
"apps": []
},
"activitycontinuation":
{
"apps": ["ID1.myApp","ID2.myApp"]
}
}

这是排除路径的正确方法吗?

"NOT /somepagelink/*"

最佳答案

是的,你的语法是正确的,但是:

Apple 文档指出,语句的顺序很重要。

Because the system evaluates each path in the paths array in the order it is specified—and stops evaluating when a positive or negative match is found—you should specify high priority paths before low priority paths.

它在您的文件中评估的第一个语句是星号“*”,表示“是的,允许每个 URL”。然后它将结束并打开应用程序。

那么也许可以反过来试试?

"paths": ["NOT /somepagelink/*", "*"],

编辑

重要:这是来自下面给出的评论,除了 AASA 的变化。您必须为 apple-app-site-association 文件的每次更改重新安装该应用程序。如果您使用其中一个,那肯定是 CDN 问题

关于ios - 在苹果应用程序站点关联文件中,为什么 "NOT"不排除提到的路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43608122/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com