mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-24 20:00:16 +08:00
feat(call-log): add plugin
feat(call-log): add plugin
This commit is contained in:
commit
973888726d
67
src/@ionic-native/plugins/call-log/index.ts
Normal file
67
src/@ionic-native/plugins/call-log/index.ts
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
export interface CallLogObject {
|
||||||
|
name: string;
|
||||||
|
value: string;
|
||||||
|
operator: '==' | '!=' | '>' | '>=' | '<' | '<=';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name Call Log
|
||||||
|
* @description
|
||||||
|
* This plugin access the call history on a device and that can be filtered
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { CallLog } from '@ionic-native/call-log';
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* constructor(private callLog: CallLog) { }
|
||||||
|
*
|
||||||
|
* ````
|
||||||
|
* @interfaces
|
||||||
|
* CallLogObject
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'CallLog',
|
||||||
|
plugin: 'cordova-plugin-calllog',
|
||||||
|
pluginRef: 'plugins.callLog',
|
||||||
|
repo: 'https://github.com/creacore-team/cordova-plugin-calllog',
|
||||||
|
platforms: ['Android']
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class CallLog extends IonicNativePlugin {
|
||||||
|
/**
|
||||||
|
* This function return the call logs
|
||||||
|
* @param filters {CallLogObject[]} array of object to filter the query
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getCallLog(filters: CallLogObject[]): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check permission
|
||||||
|
* @returns {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova({
|
||||||
|
platforms: ['Android']
|
||||||
|
})
|
||||||
|
hasReadPermission(): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request permission
|
||||||
|
* @returns {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova({
|
||||||
|
platforms: ['Android']
|
||||||
|
})
|
||||||
|
requestReadPermission(): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user