【发布时间】:2012-08-08 21:01:56
【问题描述】:
我想使用邮件应用程序将 vCard 导入我的 iOS 应用程序。我已将 public.vcard 添加到我的项目列表中。如果我尝试使用 UIDocumentInteractionController 在另一个应用程序中打开电子名片,一切都会按预期工作。但是,如果我尝试在邮件应用程序中打开电子名片,电子名片会在邮件中打开,而我的应用程序没有选择。有解决办法吗?
更新: vcard 的 plist 条目看起来像
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>vCard</string>
<key>LSHandlerRank</key>
<string>Default</string>
<key>LSItemContentTypes</key>
<array>
<string>public.vcard</string>
</array>
</dict>
</array>
【问题讨论】:
-
LSHandlerRank - 默认可能是罪魁祸首。根据“信息属性列表键参考”,“默认(默认;此应用不接受这种类型的文件)。”。此外,您的代码似乎不完整,您缺少“CFBundleTyperole”和“CFBundleTypeIconFiles”。这里有一个很不错的总结,http://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application
标签: iphone objective-c ios email vcf-vcard