@scr2em/capacitor-contacts
v0.0.4
Published
A capacitor plugin for contacts
Downloads
245
Readme
@scr2em/capacitor-contacts
A capacitor plugin for contacts
Setup
iOS
Apple requires the following usage description to be added and filled out for your app in Info.plist:
NSContactsUsageDescription (Privacy - Contacts Usage Description)
Read about Configuring Info.plist in the iOS Guide for more information on setting iOS permissions in Xcode
Android
This API requires the following permissions to be added to your AndroidManifest.xml:
<!-- Contacts API -->
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
Install
npm install @scr2em/capacitor-contacts
npx cap sync
API
openAddContact(...)
checkPermissions()
requestPermissions()
addListener('contactAdded', ...)
- Interfaces
- Type Aliases
openAddContact(...)
openAddContact(options: { vcardString: string; }) => Promise<void>
| Param | Type |
| ------------- | ------------------------------------- |
| options
| { vcardString: string; } |
checkPermissions()
checkPermissions() => Promise<{ contacts: PermissionState; }>
Returns: Promise<{ contacts: PermissionState; }>
requestPermissions()
requestPermissions() => Promise<{ contacts: PermissionState; }>
Returns: Promise<{ contacts: PermissionState; }>
addListener('contactAdded', ...)
addListener(eventName: 'contactAdded', listenerFunc: (result: { success: boolean; }) => void) => Promise<PluginListenerHandle>
| Param | Type |
| ------------------ | ------------------------------------------------------- |
| eventName
| 'contactAdded' |
| listenerFunc
| (result: { success: boolean; }) => void |
Returns: Promise<PluginListenerHandle>
Interfaces
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove
| () => Promise<void> |
Type Aliases
PermissionState
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'