Reputation: 2817
I'm currently building a site where, with one touch, you should be able to add a contact to your IPhone/Android Address book. The website is currently HTML5, but Javascript and/or PhP options could be implemented.
So is there a way that on the click of a link, the mobile device will open the Adress book already filled with the info I want it to have (Name, EMail Address, Street Address, Phone number).
I've looked everywhere to only find ways to program apps that would do the same thing. I want to make it from a webpage. Anywhere I can learn how to do this?
PS: Currently, I'm trying with everything in a .VCF file that could be downloaded on the click... this seems to lead me nowhere at the moment.
Upvotes: 12
Views: 42682
Reputation: 51
To create a VCF; paste below code in notepad. Then change the contact information part. Save it as vcf.
BEGIN:VCARD
VERSION:3.0
N:Smith;John;;Mr.;
FN:John Smith
ORG:Acme Corporation
TITLE:Sales Manager
TEL;TYPE=WORK,VOICE:(123) 456-7890
ADR;TYPE=WORK:;;123 Main St.;Anytown;CA;12345;USA
EMAIL:[email protected]
END:VCARD
Now upload this vcf file to a hosting server and get a link of that. Now this link can be share anywhare on the internet across the devices and platforms. once clicked on this link from a mobile phone. it will ask to save it as contact directly.
Upvotes: 5
Reputation: 4833
I'm was searching for this too, and I found only this "near" solution:
a video here: http://www.youtube.com/watch?v=e-2D3uCV2bE
Personally I found that solution a bit buggy, this is safer:
a video here
http://www.youtube.com/watch?v=Ws99exsZEIs
CONS:
it's counter intuitive
you need android and QR droid installed
I don't know if it's possible with iphone, and other mobiles.
Upvotes: 0
Reputation: 65785
W3C defined Contacts API as a working draft but as far as I tested it's not supported in iOS devices(I have iPad with iOS4 and iPhone with iOS 5). You should test some android devices and tell us if they support Contacts API or not. That would be useful for future readers.
In case you have contacts api supported you can do this:
if(navigator.contacts){
var mycontacts = [];
navigator.contacts( ['emails.value', 'name', 'friends'],
function(contacts) {
for(i in contacts) {
mycontacts.push(contacts[i]);
} );
}
Upvotes: 3
Reputation: 259
The first Idea i got was to use for Android (most Android-User, have a Google-Account) the Google-Contact-API.
Upvotes: 1