[英]Custom URL Scheme Parameters
When defining the custom URL scheme for my app there are 3 keys that I need information about: 在为我的应用定义自定义URL方案时,我需要以下3个键的信息:
CFBundleTypeRole
aka Document Role CFBundleTypeRole
aka文件角色 CFBundleURLName
aka URL identifier CFBundleURLName
又名URL标识符 CFBundleURLSchemes
aka URL Schemes CFBundleURLSchemes
又名URL方案 I can see, if I just define CFBundleURLSchemes
to be myapp
the app is launching fine with an URL as myapp://
. 我可以看到,如果仅将
CFBundleURLSchemes
定义为myapp
该应用程序启动正常,URL为myapp://
。 Questions are: 问题是:
myapp
defined in 2 apps, and I call myapp://
can I specify which one I want to call by calling myapp://<URL Identifier>
? myapp
,并且我调用myapp://
可以通过调用myapp://<URL Identifier>
指定要调用的方案? Edit: What does this URL Identifier actually do? None, Viewer or Editor,
I am not sure what level of permission my app has on the launched app as I have not defined anything. None, Viewer or Editor,
我不确定我的应用程序对启动的应用程序的权限级别,因为我没有定义任何内容。 I would like to know what is the default permission when the CFBundleTypeRole
is not defined. CFBundleTypeRole
时的默认权限是什么。 A protocol is not guaranteed to be unique. 不能保证协议是唯一的。 There is no parameter you can define that will open app1 or app2.
您没有定义可以打开app1或app2的参数。 If two apps use the same scheme it is undefined what happens
如果两个应用程序使用相同的方案,则不确定
the role is irrelevant for the most part BUT mandatory : 该角色在大多数情况下是无关紧要的,但必选 :
According to Apple documentation they don't give much info about the identifier and why it is needed or where it is used. 根据Apple文档,他们没有提供太多有关标识符以及为什么需要标识符或在何处使用标识符的信息。 They only say that it should be unique.
他们只说它应该是唯一的。
Also if more than one app specify the same url scheme, then the outcome is unpredictable. 同样,如果多个应用程序指定了相同的url方案,那么结果将是不可预测的。
See URL identifier and URL scheme 请参阅URL标识符和URL方案
The Role flag isn't used by iOS. iOS不使用Role标志。
See In Xcode, under Info tab, what's Role for in URL Types section? 请参阅在Xcode中“信息”选项卡下的“ URL类型”部分中的作用是什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.