将 vcard 的文件类型与 iPhone 应用程序相关联

Posted

技术标签:

【中文标题】将 vcard 的文件类型与 iPhone 应用程序相关联【英文标题】:Associate file types for vcard with an iPhone application 【发布时间】:2012-01-29 00:03:32 【问题描述】:

我在 info.plist 文件中做了以下更改

    <key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>Visiting Card</string>
        <key>CFBundleTypeIconFiles</key>
        <array>
            <string>Icon.png</string>
        </array>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.vcard</string>
        </array>
    </dict>
</array>

当我按住电子名片附件时,我没有选择在联系人应用程序或使用我的应用程序中打开它,而是简单地使用联系人应用程序打开它...我应该如何选择使用我的应用程序?请尽快回复....

【问题讨论】:

【参考方案1】:
<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>VCard Files</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.vcard</string>
        </array>
    </dict>
</array>

【讨论】:

以上是关于将 vcard 的文件类型与 iPhone 应用程序相关联的主要内容,如果未能解决你的问题,请参考以下文章

如何将vcard通讯录导入苹果手机?

创建将 vCard 直接添加到地址簿的链接

导出和导入 Vcard

从 AddressBook.framework 生成 vCard

如何将文件类型与 iPhone 应用程序相关联?

将文件类型与我的 Iphone 应用程序关联