Adding new contact in ios

I am unable to add contact in ipad i have used addcontactasync. For some reason the firstName and LastName gets added but the phoneNumber is not getting added can someone say what syntax to use.
I have used [Contacts.Fields.phoneNumber]

Hi @akhilnayak,

The field for phone number is actually phoneNumbers and it’s supposed to be provided an array. You can read about the fields in the Contact type here

Good luck!

@charliecruzan, Thank You for your help.
Here is my code:
const contact = {
[Contacts.Fields.FirstName]: this.state.firstName,
[Contacts.Fields.LastName]: this.state.lastName ,
[Contacts.Fields.PhoneNumbers]: [{ label : “mobile”,
const contactId = await Contacts.addContactAsync(contact);
alert(“Contact Saved.”)
alert(“Contact not saved.”)
alert(“Contact not Saved”)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.