Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create link that adds vCard direct to Address book

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.

like image 884
Fredy31 Avatar asked Dec 22 '11 16:12

Fredy31


People also ask

What is VCF link?

vCard, also known as VCF (Virtual Contact File), is a file format standard for electronic business cards. vCards can be attached to e-mail messages, sent via Multimedia Messaging Service (MMS), on the World Wide Web, instant messaging, NFC or through QR code.


2 Answers

[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...

like image 181
Steve Grove Avatar answered Oct 02 '22 09:10

Steve Grove


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.

like image 32
Terence Eden Avatar answered Oct 02 '22 08:10

Terence Eden