@anuradev/capacitor-contacts
v8.0.2
Published
Capacitor plugin to get and modify mobile contacts
Readme
@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(options?: RequestPermissionsOptions | undefined) => Promise<PermissionStatus>| Param | Type |
| ------------- | ------------------------------------------------------------------------------- |
| options | RequestPermissionsOptions |
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<Record<string, string[]>>Returns: Promise<Record<string, string[]>>
Interfaces
PermissionStatus
| Prop | Type |
| ------------------- | ----------------------------------------------------------- |
| readContacts | PermissionState |
| writeContacts | PermissionState |
RequestPermissionsOptions
| Prop | Type |
| ----------------- | --------------------------------- |
| permissions | ContactsPermission[] |
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'
ContactsPermission
'readContacts' | 'writeContacts'
Record
Construct a type with a set of properties K of type T
{ [P in K]: T; }
