react-native-contacts
Advanced tools
Comparing version
@@ -9,2 +9,3 @@ export function getAll(callback: (error: any, contacts: Contact[]) => void): void; | ||
export function openExistingContact(contact: Contact, callback: (error: any, contact: Contact) => void): void; | ||
export function editExistingContact(contact: Contact, callback: (error: any, contact: Contact) => void): void; | ||
export function updateContact(contact: Contact, callback: (error?: any) => void): void; | ||
@@ -11,0 +12,0 @@ export function deleteContact(contact: Contact, callback: (error?: any) => void): void; |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "5.2.0", | ||
"version": "5.2.1", | ||
"description": "React Native Contacts (android & ios)", | ||
@@ -10,0 +10,0 @@ "nativePackage": true, |
@@ -178,4 +178,5 @@  | ||
* `addContact` (contact, callback) - adds a contact to the AddressBook. | ||
* `openContactForm` (contact, callback) - create a new contact and display in contactsUI. | ||
* `openContactForm` (contact, callback) - create a new contact and display in contactsUI. | ||
* `openExistingContact` (contact, callback) - where contact is an object with a valid recordID | ||
* `editExistingContact` (contact, callback) - add numbers to the contact, where the contact is an object with a valid recordID and an array of phoneNumbers | ||
* `updateContact` (contact, callback) - where contact is an object with a valid recordID | ||
@@ -300,2 +301,23 @@ * `deleteContact` (contact, callback) - where contact is an object with a valid recordID | ||
## Add numbers to an existing contact | ||
Example | ||
```js | ||
var newPerson = { | ||
recordID: '6b2237ee0df85980', | ||
phoneNumbers: [{ | ||
label: 'mobile', | ||
number: '(555) 555-5555', | ||
}, ... | ||
] | ||
} | ||
Contacts.editExistingContact(newPerson, (err, contact) => { | ||
if (err) throw err; | ||
//contact updated | ||
}); | ||
``` | ||
Add one or more phone numbers to an existing contact. | ||
On Android the edited page will be opened. | ||
On iOS the already edited contact will be opened with the possibility of further modification. | ||
### Bugs | ||
@@ -302,0 +324,0 @@ There are issues with updating contacts on Android: |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
232368
4.06%1866
2.25%409
5.68%