From 76a644d1224b8244f9e99f44b10fcd30b69a43c6 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 28 Jan 2018 02:19:09 +0100 Subject: [PATCH] feat(call-log): add plugin --- src/@ionic-native/plugins/call-log/index.ts | 58 +++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/@ionic-native/plugins/call-log/index.ts diff --git a/src/@ionic-native/plugins/call-log/index.ts b/src/@ionic-native/plugins/call-log/index.ts new file mode 100644 index 00000000..9119f78b --- /dev/null +++ b/src/@ionic-native/plugins/call-log/index.ts @@ -0,0 +1,58 @@ +import { Injectable } from '@angular/core'; +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; + +/** + * @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) { } + * + * ... + * + */ +@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 does something + * @param dateFrom {string} get call logs from this date (format yyyy-dd-mm) + * @param dateTo {string} get call logs until this date (format yyyy-dd-mm) + * @param filters {object[]} array of object to filter the query + * Object must respect this structure {'name':'...', 'value': '...', 'operator': '=='} + * (see https://github.com/creacore-team/cordova-plugin-calllog for more details) + * @return {Promise} + */ + @Cordova() + getCallLog(dateFrom: string, dateTo: string, filters: object[]): Promise { return; } + + /** + * Check permission + * @returns {Promise} + */ + @Cordova({ + platforms: ['Android'] + }) + hasReadPermission(): Promise { return; } + + /** + * Request permission + * @returns {Promise} + */ + @Cordova({ + platforms: ['Android'] + }) + requestReadPermission(): Promise { return; } +}