I want to allow users to import their contact(email) into my php application. I am considering vcard format as most mobile phones allow vcard export. Now i have a few doubt
Do iphone, android, blackberry, symbian allow export as vcard and is the vcard format same by all.
Also u can export Gmail contacts vcard is that too in same format
Can u export apple mail, outlook, thunderbird contacts as vcard
I would think that if they abide with the standard (Cant be sure as not lucky enough to own all those devices) then yes they should export the same.
From http://en.wikipedia.org/wiki/VCard
The following is an example of a VCard file containing information for one person:
vCard 2.1:
BEGIN:VCARD
VERSION:2.1
N:Gump;Forrest
FN:Forrest Gump
ORG:Bubba Gump Shrimp Co.
TITLE:Shrimp Man
TEL;WORK;VOICE:(111) 555-1212
TEL;HOME;VOICE:(404) 555-1212
ADR;WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:100 Waters Edge=0D=0ABaytown, LA 30314=0D=0AUnited States of America
ADR;HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:42 Plantation St.=0D=0ABaytown, LA 30314=0D=0AUnited States of America
EMAIL;PREF;INTERNET:forrestgump@example.com
REV:20080424T195243Z
END:VCARD
vCard 3.0:
BEGIN:VCARD
VERSION:3.0
N:Gump;Forrest
FN:Forrest Gump
ORG:Bubba Gump Shrimp Co.
TITLE:Shrimp Man
PHOTO;VALUE=URL;TYPE=GIF:http://www.example.com/dir_photos/my_photo.gif
TEL;TYPE=WORK,VOICE:(111) 555-1212
TEL;TYPE=HOME,VOICE:(404) 555-1212
ADR;TYPE=WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America
LABEL;TYPE=WORK:100 Waters Edge\nBaytown, LA 30314\nUnited States of America
ADR;TYPE=HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
LABEL;TYPE=HOME:42 Plantation St.\nBaytown, LA 30314\nUnited States of America
EMAIL;TYPE=PREF,INTERNET:forrestgump@example.com
REV:20080424T195243Z
END:VCARD
Version 2.1 of the vCard standard is widely supported by e-mail clients. Version 3.0 of the vCard format is an IETF standards-track proposal contained in RFC 2425 and RFC 2426.
iOS provide any mechanisms for accessing the contacts database within mobile Safari. The only way to export contacts en mass would be through a native app.
A very kludgey way to export contacts one at time from iOS would be by email. iOS lets a user fairly easily send a .vcard file as an email attachment.
A workflow could go about like this:
- Have the user opt-in for contact exporting by email
- Generate a unique email address for a user on your server.
Something similar to the post by email addresses that flickr
and others provide, something along the lines of
contacts-export+[unique string]@exmple.com
- Instruct user to add said email address to the iOS contacts database
(tap & hold on email address ->Create New Contact
) - Instruct user to open the Contacts app find the contact(s) they wish to export and for each contact
selectShare Contact
->Email
-> send to the previously saved email address - Create a cron job to periodically check and process these incoming messages
This all seems like a lot of work for both the end user and you, the developer. That being said if your users are savvy enough to handle that convoluted workflow, it would certainly be much handier than copy/pasting for one off contact exporting, particularly for any contact that has more than just one or two associated fields.
I'm not sure what Android, Blackberry, et al support in terms of exporting.
来源:https://stackoverflow.com/questions/6971412/exporting-and-importing-vcard