ios - URL 标识符和 URL 方案

标签 ios url-scheme

在 iOS 中,您可以设置 URL 架构,以便其他应用可以启动您或向您传递数据。什么是 URL 标识符?除了指定 URL Schemes 之外,它似乎没有在任何地方使用。

另外,如果手机上有重复的 URL schemes 会怎样?

最佳答案

根据 Apple documentation他们没有提供太多关于标识符的信息以及为什么需要它或在哪里使用它。他们只说它应该是独一无二的:

A string containing the abstract name of the URL scheme. To ensure uniqueness, it is recommended that you specify a reverse-DNS style of identifier, for example, com.acme.myscheme. The string you specify is also used as a key in your app’s InfoPlist.strings file. The value of the key is the human-readable scheme name.

此外,如果多个应用指定相同的 url scheme,则结果不可预测:

Note: If more than one third-party app registers to handle the same URL scheme, there is currently no process for determining which app will be given that scheme.

经验告诉我,首先注册该方案的应用程序将被打开,但这可能是错误的。

关于ios - URL 标识符和 URL 方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16597631/

相关文章:

jquery - iOS Phonegap 应用程序使用 XMLHTTPRequest 发布到安全的 Web 服务调用返回状态为 0

ios - 创建一个私有(private) pod ,没有任何存储库的 source 属性

html - iOS Safari 上 Pinterest 的自定义 URL 方案以打开板 URL?

ios - 获取网络应用程序的 Box iOS 应用程序 url 方案参数

javascript - 标准协议(protocol)路径的规则是什么?

ios - 从 url 方案中获取文本字符串在 appdelegate 中有效,但在 viewcontroller 中无效

java - 带有 JDBC 的 Gluon 示例项目在 iOS 设备上不起作用

ios - 如何获取用户位置

iphone - 当应用程序不在后台时,URL 方案不起作用

ios - 如何在数组中创建一个数组,然后检查它是否包含字符串。 ( swift )