Call Directory
This plugin can add phone numbers to an Callkit call directory extension. Call reloadExtension
after using addIdentification
and removeIdentification
to process the changes in the call directory extension.
Repo: https://github.com/GEDYSIntraWare/cordova-plugin-call-directory
Installation
- Install the Cordova and Ionic Native plugins:
$ cordova plugin add cordova-plugin-call-directory --variable EXT_NAME="Cordova-Directory" --variable ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES="NO" $ npm install --save @ionic-native/call-directory@4
- Add this plugin to your app's module
Supported platforms
- iOS
Usage
import { CallDirectory } from '@ionic-native/call-directory';
constructor(private callDirectory: CallDirectory) { }
let items = [{label: "Hello", number: "123"}];
this.callDirectory.addIdentification(items)
.then((res: any) => console.log(res))
.catch((error: any) => console.error(error));
this.callDirectory.reloadExtension()
.then(res: string) => console.log(res))
.catch((error: any) => console.error(error));
Instance Members
isAvailable()
Check if the call directory extension is available and enabled
Returns: Promise<boolean>
Returns a promise with result
addIdentification(items)
Add identification numbers
Param | Type | Details |
---|---|---|
items |
Array<CallDirectoryItem>
|
Set of numbers with labels |
Returns: Promise<any>
Returns a promise that resolves when numbers are added
removeIdentification(items)
Remove identification numbers
Param | Type | Details |
---|---|---|
items |
Array<CallDirectoryItem>
|
Set of numbers with arbitrary label |
Returns: Promise<any>
Returns a promise that resolves when numbers are removed
removeAllIdentification()
Remove all items from call directory. Refreshes immediately.
Returns: Promise<any>
Returns a promise after refresh with message
getAllItems()
Get all numbers and labels in call directory
Returns: Array<CallDirectoryItem>
Returns a promise that resolves with an array of all items
reloadExtension()
Reload extension to process queued changes
Returns: Promise<string>
Returns a promise after refresh with message
getLog()
Get log from plugin and call directory extension
Returns: Promise<CallDirectoryLog>
Returns a promise with an object of log messages