Allow to save multiple contact detail in ionic capacitor
npm install bulk-contact
npx cap sync
BulkContact.getPermissions().then(permissionResponse => {
if (permissionResponse) {
if (permissionResponse.granted) {
for (const currentContact of contactList) {
BulkContact.saveContact({
name: currentContact.name,
mobile: currentContact.mobile
}).then(() => {
console.log('contact saved');
}).catch((exception) => {
console.log(exception);
});
}
} else {
console.log('permission denied');
}
}
});
getPermissions() => Promise<PermissionStatus>
Returns: Promise<PermissionStatus>
getContacts() => Promise<{ contacts: Contact[]; }>
Returns: Promise<{ contacts: Contact[]; }>
saveContact(contact: NewContact) => Promise<void>
Prop |
Type |
granted |
boolean |
Prop |
Type |
contactId |
string |
displayName |
string |
phoneNumbers |
PhoneNumber[] |
emails |
EmailAddress[] |
photoThumbnail |
string |
organizationName |
string |
organizationRole |
string |
birthday |
string |
Prop |
Type |
label |
string |
number |
string |
Prop |
Type |
label |
string |
address |
string |
New contact schema.
Prop |
Type |
name |
string |
mobile |
string |