Question

I'm in the process of building a mobile site (for Iphones and Androids... I think Blackberry is out of it)

Here the problem I'm with. We want to have a link that, when clicked, automatically adds the contact in the .vcf file to the address book of the mobile device (with some confirmation of some sort that the iPhone/Android must already be handling by itself)

The solution I've tried would be to create a link, directly pointing to the .vcf file. It didn't work. My iTouch was even asking what to open that file with... and the Contact app was not even in the list.

I've heard that a Card of that sort would do exactly what we want if it would come from an email... thing is, we are building up a webpage here.

We use HTML5, no PhP (not yet, could be added later for this problem) and there is no CMS involved.

Was it helpful?

Solution

Firstly, iPhone doesn't support vCard. There is no way to download a contact file from the web. What you could do is create a simple page which contains links to the phone number, like this:

<a href="tel:1800555555">Call Dave</a>

Secondly, to get an Android (or other device) to recognise the vCard, you need to set the header to the correct MIME type

Content-Type: text/vcard

You should be able to configure your server to send all files of .vcf as text/vcard.

OTHER TIPS

[UPDATED - Sep 2013 - iOS7 now supports direct download of VCARDs from we page and import into native contact application]

Complete solution using VCALENDAR file with emebedded VCARD file is published here

iPhone: how to get safari to recognize a vcard?

which includes link to my blog with full source code on the subject at

http://mobicontact.info/iphone/download-contact-from-web-page/

I hope this is of some help...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top