The ios mail application does not open vcard in my application

I would like to import vCards into my iOS application using a mail application. I added public.vcard to my plist projects. If I try to open vcard in another application using the UIDocumentInteractionController , everything will work as expected. However, if I try to open vCard in a mail application, vCard opens by mail without a choice for my application. Is there a solution?

UPDATE: The plist entry for vcard looks like

 <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> 
+4
source share
2 answers

This entry looks pretty incomplete for me. As a rule, if the yor application can open certain types, you need to have either an import declaration (if the file format belongs to another application) or an export declaration (if the format belongs to yours)

iOS and Mac correspond to UTI mainly by extension, so I think you also need to have this in the ad. Use the UTI features on iOS to check if there really is a public.vCard type assigned to expand your file. If not, then you can not find it.

I would add UTImportedTypeDeclarations to your plist if there is such an association, if not add UTExportedTypeDeclarations

I wrote this tutorial to explain everything you need: http://www.cocoanetics.com/2012/09/fun-with-uti/

0
source

This seems impossible with iOS 7.0.4.

iOS seems to handle some file types in the Mail app differently than others. In the Mail application, you cannot open these types of files in applications that are not owned by Apple.

You can verify this using the UIDocumentInteractionController to open the file programmatically. This will force the user to open the file in many applications (in all applications that have registered this type of file or more general. Dropbox application, for example, almost opens everything).

When you send the same file to yourself and try to open it in the Mail application, you will not receive these parameters (for example, Dropbox).

I checked this by registering VCard / .vcf, Jpegs, and the user type.

0
source

All Articles