Create a link that will add vCard directly to your address book

I am creating a mobile site (for iPhones and Androids ... I think Blackberry is not working)

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

The solution I tried is to create a link directly pointing to the .vcf file. This did not work. My iTouch even asked what to open this file ... and the Contact application wasn’t even on the list.

I heard that a map of this kind will do exactly what we want if it is received from e-mail ... The fact is that we are creating a web page here.

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

+6
source share
2 answers

Firstly, iPhone does not support vCard. Unable to download contact file from the Internet. What you can do is create a simple page containing links to a phone number, for example:

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

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

 Content-Type: text/vcard 

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

+1
source

[UPDATED - September 2013 - iOS7 now supports direct download of VCARD from our page and imports it into the application for native contacts]

The complete solution is published here using a VCALENDAR file with an emebedded VCARD file

iPhone: how to get vcard recognition safari?

which includes a link to my full source blog on the topic

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

Hope this helps ...

+4
source

Source: https://habr.com/ru/post/904328/


All Articles