0

How can I save my contacts as a group on the phone? Anyone have an idea?

Ehsan
  • 308
  • 6
  • 17

1 Answers1

-1

It is right there in the documentation of the library you're asking about github.com/morenoh149/react-native-contacts#adding-contacts

import Contacts from 'react-native-contacts';

var newPerson = {
  emailAddresses: [{
    label: "work",
    email: "mrniet@example.com",
  }],
  familyName: "Nietzsche",
  givenName: "Friedrich",
}

Contacts.addContact(newPerson, (err) => {
  if (err) throw err;
  // save successful
})

Please take the time to read the documentation about your tool, and try things before asking a question on here. This is my personal suggestion as it's beneficial for you at the end.

qasimalbaqali
  • 2,079
  • 24
  • 51
  • i have already read the document. there is no way in this library to save contact as a group in the phone – Narges Mohammadi Aug 18 '20 at 10:17
  • I suggest then replying to this question with your outcome and marking it as the accepted answer, you might be able to use androids internal API for contacts to pull up the contacts app because I am pretty sure that is possible. Many apps out there such as Whatsapp does this. – qasimalbaqali Aug 18 '20 at 15:52