9

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.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Fredy31
  • 2,660
  • 6
  • 29
  • 54

2 Answers2

5

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

Community
  • 1
  • 1
Steve Grove
  • 915
  • 10
  • 18
1

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.

Terence Eden
  • 14,034
  • 3
  • 48
  • 89
  • 3
    Not technically true, you can get a vcard... you just have to embed it in a vcal for iOS < 7. See http://stackoverflow.com/questions/1892373/iphone-how-to-get-safari-to-recognize-a-vcard – Will Hancock Sep 23 '13 at 15:08
  • So how can I achieve a seamless solution for both Android and iOS using a single NFC Card. Which is: * Directly opens as a vCard for Android without opening any URL * And open a URL for iPhone where it directly opens a vcf file as a contact. Is this possible somehow? – Mohsin Falak Jul 15 '21 at 01:36