@anuradev/capacitor-phone-call-notification
v2.0.6
Published
Capacitor plugin to create phone call notifications
Downloads
28
Readme
@anuradev/capacitor-phone-call-notification
Capacitor plugin to create phone call notifications
Install
npm install @anuradev/capacitor-phone-call-notification
npx cap sync
API
show(...)
hide(...)
checkPermissions()
requestPermissions()
addListener('response', ...)
removeAllListeners()
- Interfaces
- Type Aliases
show(...)
show(data?: Partial<NotificationSettings> | undefined) => Promise<void>
| Param | Type |
| ---------- | ----------------------------------------------------------------------------------------------------------- |
| data
| Partial<NotificationSettings> |
hide(...)
hide(data: { type: NotificationType; }) => Promise<void>
| Param | Type |
| ---------- | ------------------------------------------------------------------------ |
| data
| { type: NotificationType; } |
checkPermissions()
checkPermissions() => Promise<PermissionStatus>
Returns: Promise<PermissionStatus>
requestPermissions()
requestPermissions() => Promise<PermissionStatus>
Returns: Promise<PermissionStatus>
addListener('response', ...)
addListener(eventName: 'response', listenerFunc: (data: { response: NotificationResponse; }) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type |
| ------------------ | ------------------------------------------------------------------------------------------------------- |
| eventName
| 'response' |
| listenerFunc
| (data: { response: NotificationResponse; }) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
removeAllListeners()
removeAllListeners() => Promise<void>
Interfaces
NotificationSettings
| Prop | Type |
| ----------------------------------- | ------------------------------------------------------------- |
| type
| NotificationType |
| duration
| number |
| callerName
| string |
| callerNumber
| string |
| icon
| string |
| picture
| string |
| thereIsACallInProgress
| boolean |
| declineButtonText
| string |
| declineButtonColor
| string |
| answerButtonText
| string |
| answerButtonColor
| string |
| terminateButtonText
| string |
| terminateButtonColor
| string |
| holdButtonText
| string |
| holdButtonColor
| string |
| terminateAndAnswerButtonText
| string |
| terminateAndAnswerButtonColor
| string |
| declineSecondCallButtonText
| string |
| declineSecondCallButtonColor
| string |
| holdAndAnswerButtonText
| string |
| holdAndAnswerButtonColor
| string |
| color
| string |
| channelName
| string |
| channelDescription
| string |
PermissionStatus
| Prop | Type |
| ------------- | ----------------------------------------------------------- |
| display
| PermissionState |
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove
| () => Promise<void> |
Type Aliases
Partial
Make all properties in T optional
{ [P in keyof T]?: T[P]; }
NotificationType
'incoming' | 'inProgress' | 'missed'
PermissionState
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'
NotificationResponse
'tap' | 'answer' | 'decline' | 'terminate' | 'hold'