Page 1 of 1

Can I write to my Phone's Contacts Using the Contact Service

Posted: Sat Jul 25, 2015 9:56 am
by Deon

Hi

I am able to list contacts. I would alos like to be able to write contacts. Is that possible?

Thanks


Can I write to my Phone's Contacts Using the Contact Service

Posted: Sat Jul 25, 2015 2:31 pm
by Evgene Karachevtsev

Hello Deon,

Sorry, I'm not sure I understand you correctly, could you please clarify - you want to create a new contact in a phone contacts using your app?


Can I write to my Phone's Contacts Using the Contact Service

Posted: Sun Jul 26, 2015 6:09 am
by Deon

Hi Evgene

Correct. It seems that the Contacts Service only allows you to retrieve contacts and and there is no facility to write to contacts.

I have created an app to collect contact info and I need this to be written to the Device's Contacts.

Thank you


Can I write to my Phone's Contacts Using the Contact Service

Posted: Tue Jul 28, 2015 1:31 am
by Yurii Orishchuk

Hi Deon,

Yes contacts service only gets contacts from device..

Here is a JS code to add needed contact to device:

pre

//Here contact details object.
var testContact = {"displayName": "Test User1"};

var myContact = navigator.contacts.create(testContact);
myContact.save();

/pre

You can fill "testContact" object with all field you need.

Regards.


Can I write to my Phone's Contacts Using the Contact Service

Posted: Tue Jul 28, 2015 7:38 am
by Deon

Awesome, thank you Yurri!