feat(call-log): add plugin

feat(call-log): add plugin
This commit is contained in:
Daniel Sogl 2018-03-17 00:49:45 +01:00 committed by GitHub
commit 973888726d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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;
}
}