Capacitor plugin to get and modify mobile contacts
npm install @anuradev/capacitor-contactsCapacitor plugin to get and modify mobile contacts
``bash`
npm install @anuradev/capacitor-contacts
npx cap sync
* checkPermissions()
* requestPermissions()
* getContacts()
* createContact(...)
* addToExistingContact(...)
* deleteContact(...)
* getGroups()
* getContactGroups()
* Interfaces
* Type Aliases
`typescript`
checkPermissions() => Promise
Returns: Promise<PermissionStatus>
--------------------
`typescript`
requestPermissions() => Promise
Returns: Promise<PermissionStatus>
--------------------
`typescript`
getContacts() => Promise<{ contacts: Contact[]; }>
Returns: Promise<{ contacts: Contact[]; }>
--------------------
`typescript`
createContact(data: { name?: string; number: string; }) => Promise
| Param | Type |
| ---------- | ----------------------------------------------- |
| data | { name?: string; number: string; } |
--------------------
`typescript`
addToExistingContact(data: { name?: string; number: string; }) => Promise
| Param | Type |
| ---------- | ----------------------------------------------- |
| data | { name?: string; number: string; } |
--------------------
`typescript`
deleteContact(data: { contactId: string; }) => Promise
| Param | Type |
| ---------- | ----------------------------------- |
| data | { contactId: string; } |
--------------------
`typescript`
getGroups() => Promise<{ groups: Group[]; }>
Returns: Promise<{ groups: Group[]; }>
--------------------
`typescript`
getContactGroups() => Promise<{ [key: string]: Group[]; }>
Returns: Promise<{ [key: string]: Group[]; }>
--------------------
#### PermissionStatus
| Prop | Type |
| ------------- | ----------------------------------------------------------- |
| display | PermissionState |
#### 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 |
#### Group
| Prop | Type |
| ----------------- | ------------------- |
| groupId | string |
| accountType | string |
| accountName | string |
| title` | string |
#### PermissionState
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'