简体   繁体   English

如何限制除iOS通用链接以外的所有其他路径以使用URL打开应用

[英]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.

相关问题 如何防止ios通用链接在用户点击子域A页面中的url时打开APP,并且该url链接到子域B - how to prevent ios universal link open the APP when user click a url in subdomain A page, and the url is linking to subdomain B 通用链接无法在iOS上打开应用 - Universal link doesn't open the app on iOS iOS:如果应用程序未打开,苹果通用链接? - iOS: apple universal link if app is not open? 如何使用自定义iOS应用程序中的URL链接将Safari(或Adobe或任何其他应用程序)打开到特定网页或文档? - How to open Safari (or Adobe, or any other app) to a specific webpage or document using a URL link from within my custom iOS application? iOS Universal Links:如何从URL中排除某些路径? - iOS Universal Links: how to exclude certain paths from URL? 如何将 iOS 10 通用应用程序中的单个 UIViewController 限制为纵向布局? - How to restrict single UIViewController in iOS 10 universal app to portrait layout? iOS通用链接:如果未安装应用,则打开商店链接 - Universal links iOS : open store link if app NOT installed 在iOS 9 Safari中粘贴通用链接,但应用不会自动打开 - Paste universal link in iOS 9 safari, but app does not open automatically 如何使用url打开ios app? - How to open ios app using url? 如何使用Swift从WebKit iOS应用中的tel:url链接打开电话 - How do I open phone from tel: url link from WebKit iOS app using Swift
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM