0.0.4 • Published 2 years ago
bulk-contact
Allow to save multiple contact detail in ionic capacitor
Install
npm install bulk-contact
npx cap sync
Example
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');
}
}
});
API
getPermissions()
getPermissions() => Promise<PermissionStatus>
Returns: Promise<PermissionStatus>
getContacts()
getContacts() => Promise<{ contacts: Contact[]; }>
Returns: Promise<{ contacts: Contact[]; }>
saveContact(...)
saveContact(contact: NewContact) => Promise<void>
Param | Type |
---|
contact | NewContact |
Interfaces
PermissionStatus
Contact
Prop | Type |
---|
contactId | string |
displayName | string |
phoneNumbers | PhoneNumber[] |
emails | EmailAddress[] |
photoThumbnail | string |
organizationName | string |
organizationRole | string |
birthday | string |
PhoneNumber
Prop | Type |
---|
label | string |
number | string |
EmailAddress
Prop | Type |
---|
label | string |
address | string |
NewContact
New contact schema.
Prop | Type |
---|
name | string |
mobile | string |