如果我想要iOS应用程序App1在设备上启动应用程序App2,那么CFBundleURLName是否需要与Info.plist中CFBundleURLTypes中的CFBundleIdentifier匹配?
例如,如果我在App1中有以下设置:
<key>CFBundleIdentifier</key>
<string>com.foo.App1</string>
...
<key>CFBundleURLTypes</key>
<array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fooscheme</string>
</array>
<key>CFBundleURLName</key>
<string>com.foo.App1</string>
</dict>
</array>
在上述情况下,App2可以在App1中启动“fooscheme:”URL。但是,如果我更改App1的Info.plist以包括
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fooscheme</string>
</array>
<key>CFBundleURLName</key>
<string>com.foo.xyz</string>
</dict>
</array>
例如,如果CFBundleURLName!= CFBundleIdentifier,则App2无法在App1中启动“fooscheme:”网址。
有任何想法为什么会这样吗?
我没有看到任何苹果文档说明CFBundleIdentifier必须与CFBundleURLName匹配,但实际上似乎是这样的。或者我错过了什么?
谢谢!