bulk-contact
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

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

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

Readme

Keywords

Package Sidebar

Install

npm i bulk-contact

Weekly Downloads

1

Version

0.0.4

License

MIT

Unpacked Size

30.3 kB

Total Files

27

Last publish

Collaborators

  • anandvsh