1.0.1 • Published 3 years ago
voip-callkit
capacitor plugin for callkit and voip
Install
npm install voip-callkit
npx cap sync
API
register(...)
register(options: { topic: string; }) => Promise<void>
| Param | Type | 
|---|
| options | { topic: string; } | 
incomingCall(...)
incomingCall(options: { from: string; }) => Promise<void>
| Param | Type | 
|---|
| options | { from: string; } | 
addListener('registration', ...)
addListener(eventName: 'registration', listenerFunc: (token: Token) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type | 
|---|
| eventName | 'registration' | 
| listenerFunc | (token: Token) => void | 
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
addListener('callAnswered', ...)
addListener(eventName: 'callAnswered', listenerFunc: (callDate: CallData) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type | 
|---|
| eventName | 'callAnswered' | 
| listenerFunc | (callDate: CallData) => void | 
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
addListener('callStarted', ...)
addListener(eventName: 'callStarted', listenerFunc: (callDate: CallData) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type | 
|---|
| eventName | 'callStarted' | 
| listenerFunc | (callDate: CallData) => void | 
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Interfaces
PluginListenerHandle
| Prop | Type | 
|---|
| remove | () => Promise<void> | 
Token
CallData
| Prop | Type | 
|---|
| connectionId | string | 
| username | string | 
MessageCallData
| Prop | Type | 
|---|
| type | 'message' | 
| callbackId | string | 
| pluginId | string | 
| methodName | string | 
| options | any | 
ErrorCallData
| Prop | Type | 
|---|
| type | 'js.error' | 
| error | { message: string; url: string; line: number; col: number; errorObject: string; } | 
Type Aliases
CallData
MessageCallData | ErrorCallData