bulk-contact
v0.0.4
Published
Allow to save multiple contact detail
Readme
bulk-contact
Allow to save multiple contact detail in ionic capacitor
Install
npm install bulk-contact
npx cap syncExample
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
| Prop | Type |
| ------------- | -------------------- |
| granted | boolean |
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 |
