Languages

Menu
Sites
Language
convertToString exporting contacts

Hello

https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.web.appprogramming%2Fhtml%2Ftutorials%2Fsocial_tutorial%2Fexport_contacts.htm

 

var addressbook;

var addressbook = tizen.contact.getDefaultAddressBook();

addressbook.find(contactsFoundCB, errorCB);

function contactsFoundCB(contacts){

    /* Convert the first contact */

    var vcard = contacts[0].convertToString("VCARD_30");

    console.log("textual representation of the contact is: " + vcard);

 }

I get the answer to the console

BEGIN:VCARD
soleMessage( 2834): VERSION:3.0
Message( 2834): N;CHARSET=UTF-8:;Qwe;;;
soleMessage( 2834): FN;CHARSET=UTF-8:Qwe
ssage( 2834): TEL;TYPE=CELL;PREF;CHARSET=UTF-8:123123123
leMessage( 2834): END:VCARD

 

Qwe – Name, 123123123 — phone

Please tell me how I can quickly parse it?

 

 

 

Responses

3 Replies
Marco Buettner
Andrew Gudz

I use again tizen object

var tContact = new tizen.Contact(vcard);

 

Alexander AVSukhov

Hello,

You may use https://github.com/mattt/vcard.js