7.0.0 • Published 1 year ago
@anuradev/capacitor-contacts v7.0.0
@anuradev/capacitor-contacts
Capacitor plugin to get and modify mobile contacts
Install
npm install @anuradev/capacitor-contacts
npx cap syncAPI
checkPermissions()requestPermissions()getContacts()createContact(...)addToExistingContact(...)deleteContact(...)getGroups()getContactGroups()- Interfaces
- Type Aliases
checkPermissions()
checkPermissions() => Promise<PermissionStatus>Returns: Promise<PermissionStatus>
requestPermissions()
requestPermissions() => Promise<PermissionStatus>Returns: Promise<PermissionStatus>
getContacts()
getContacts() => Promise<{ contacts: Contact[]; }>Returns: Promise<{ contacts: Contact[]; }>
createContact(...)
createContact(data: { name?: string; number: string; }) => Promise<void>| Param | Type |
|---|---|
data | { name?: string; number: string; } |
addToExistingContact(...)
addToExistingContact(data: { name?: string; number: string; }) => Promise<void>| Param | Type |
|---|---|
data | { name?: string; number: string; } |
deleteContact(...)
deleteContact(data: { contactId: string; }) => Promise<void>| Param | Type |
|---|---|
data | { contactId: string; } |
getGroups()
getGroups() => Promise<{ groups: Group[]; }>Returns: Promise<{ groups: Group[]; }>
getContactGroups()
getContactGroups() => Promise<{ [key: string]: Group[]; }>Returns: Promise<{ key: string: Group[]; }>
Interfaces
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 |
Type Aliases
PermissionState
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'