Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attach a vCard to MFMessageComposeViewController

I am trying to attach a .vcf file to the MFMessageComposeViewController as a share contact feature in my app. I referred this link and it is said that there is no possibility to send a contact info through message composer. I also tried setting the encoded string to the message body as suggested in this link, which also didn't work. I don't know how it is implemented in the default message app as in the below image.

Contacts info in the MessageComposer

Can anyone suggest me how to implement this share contact option as in the default Contacts app of the iPhone? Any timely help is much more appreciated.

like image 403
Ananth Avatar asked Mar 07 '26 18:03

Ananth


1 Answers

Adding attachment feature is added in iOS7 with the MFMessageComposeViewController class. The method – addAttachmentData:typeIdentifier:filename: gives the answer where typeIdentifier can be set as kUTTypeVCard.

like image 169
Ananth Avatar answered Mar 10 '26 06:03

Ananth