[英]How to restrict all other paths except one for Universal link in iOS to open app using URL
I am using Unviversal link in iOS application. 我在iOS应用程序中使用Unviversal链接。 I am referring Apple doc: https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html 我指的是Apple文档: https : //developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html
I want to open app for only one path. 我只想打开一个应用程序。 example domain is https://example.com and paths are /a, /b, and so on. 示例域是https://example.com ,路径是/ a,/ b,依此类推。 I want to give access to only '/b' path. 我只想访问“ / b”路径。 How do I do it? 我该怎么做?
Universal Links operate on an opt-in basis for URLs. 通用链接针对URL选择启用。 In other words, if you don't explicitly specify a path in the apple-app-site-association
file (either by literal string or wildcard matching), it won't be used. 换句话说,如果您未在apple-app-site-association
文件中显式指定路径(通过文字字符串或通配符匹配),则不会使用该路径。
Using Apple's example as a basis: 以Apple的示例为基础:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "9JA89QQLNQ.com.apple.wwdc",
"paths": [ "/b"]
}
]
}
}
Identify an area that should not be handled by adding “NOT ” (including a space after the T) to the beginning of the path string. 通过在路径字符串的开头添加“ NOT”(包括T后面的空格)来标识不应处理的区域。 For example, you Want to prevent to handle the /videos/samples/2010/* area of the website then the paths array as shown here: 例如,您要防止处理网站的/ videos / samples / 2010 / *区域,然后处理路径数组,如下所示:
"paths": [ "/videos/collections/*", "NOT /videos/samples/2010/*", "/videos/samples/201?/*"]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.