@anuradev/capacitor-contacts
Capacitor plugin to get and modify mobile contacts
npm install @anuradev/capacitor-contacts
npx cap sync
checkPermissions() => Promise<PermissionStatus>
Returns: Promise<PermissionStatus>
requestPermissions() => Promise<PermissionStatus>
Returns: Promise<PermissionStatus>
getContacts() => Promise<{ contacts: Contact[]; }>
Returns: Promise<{ contacts: Contact[]; }>
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(data: { contactId: string; }) => Promise<void>
Param |
Type |
data |
{ contactId: string; } |
getGroups() => Promise<{ groups: Group[]; }>
Returns: Promise<{ groups: Group[]; }>
getContactGroups() => Promise<{ [key: string]: Group[]; }>
Returns: Promise<{ [key: string]: Group[]; }>
Prop |
Type |
contactId |
string |
displayName |
string |
phoneNumbers |
PhoneNumber[] |
emails |
EmailAddress[] |
photoThumbnail |
string |
organizationName |
string |
organizationRole |
string |
birthday |
string |
Prop |
Type |
label |
string |
number |
string |
Prop |
Type |
label |
string |
address |
string |
Prop |
Type |
groupId |
string |
accountType |
string |
accountName |
string |
title |
string |
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'