From 76a644d1224b8244f9e99f44b10fcd30b69a43c6 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 28 Jan 2018 02:19:09 +0100 Subject: [PATCH 1/4] 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; } +} From 4b9cf17cbb90028bfda431166f620618289e2209 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 28 Jan 2018 13:53:16 +0100 Subject: [PATCH 2/4] fix(call-log): comments erratum --- src/@ionic-native/plugins/call-log/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/@ionic-native/plugins/call-log/index.ts b/src/@ionic-native/plugins/call-log/index.ts index 9119f78b..1438047f 100644 --- a/src/@ionic-native/plugins/call-log/index.ts +++ b/src/@ionic-native/plugins/call-log/index.ts @@ -27,9 +27,9 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; 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) + * This function return the call logs + * @param dateFrom {string} get logs from this date (format yyyy-MM-dd) + * @param dateTo {string} get logs until this date (format yyyy-MM-dd) * @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) From 61c0ecfa4f50b61381e76c85f1d24f4770a213ed Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 30 Jan 2018 22:35:48 +0100 Subject: [PATCH 3/4] fix(call-log): update getCallLog signature --- src/@ionic-native/plugins/call-log/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/@ionic-native/plugins/call-log/index.ts b/src/@ionic-native/plugins/call-log/index.ts index 1438047f..d7a54119 100644 --- a/src/@ionic-native/plugins/call-log/index.ts +++ b/src/@ionic-native/plugins/call-log/index.ts @@ -28,15 +28,13 @@ export class CallLog extends IonicNativePlugin { /** * This function return the call logs - * @param dateFrom {string} get logs from this date (format yyyy-MM-dd) - * @param dateTo {string} get logs until this date (format yyyy-MM-dd) * @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; } + getCallLog(filters: object[]): Promise { return; } /** * Check permission From 5e40f3412ab2aac16e7c30b10d77b9fa7ae89160 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Sat, 17 Mar 2018 00:47:46 +0100 Subject: [PATCH 4/4] add CallLogObject interface --- src/@ionic-native/plugins/call-log/index.ts | 29 ++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/@ionic-native/plugins/call-log/index.ts b/src/@ionic-native/plugins/call-log/index.ts index d7a54119..fd790628 100644 --- a/src/@ionic-native/plugins/call-log/index.ts +++ b/src/@ionic-native/plugins/call-log/index.ts @@ -1,5 +1,11 @@ import { Injectable } from '@angular/core'; -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; + +export interface CallLogObject { + name: string; + value: string; + operator: '==' | '!=' | '>' | '>=' | '<' | '<='; +} /** * @name Call Log @@ -13,7 +19,9 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; * * constructor(private callLog: CallLog) { } * - * ... + * ```` + * @interfaces + * CallLogObject * */ @Plugin({ @@ -25,16 +33,15 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; }) @Injectable() export class CallLog extends IonicNativePlugin { - /** * This function return the call logs - * @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) + * @param filters {CallLogObject[]} array of object to filter the query * @return {Promise} */ @Cordova() - getCallLog(filters: object[]): Promise { return; } + getCallLog(filters: CallLogObject[]): Promise { + return; + } /** * Check permission @@ -43,7 +50,9 @@ export class CallLog extends IonicNativePlugin { @Cordova({ platforms: ['Android'] }) - hasReadPermission(): Promise { return; } + hasReadPermission(): Promise { + return; + } /** * Request permission @@ -52,5 +61,7 @@ export class CallLog extends IonicNativePlugin { @Cordova({ platforms: ['Android'] }) - requestReadPermission(): Promise { return; } + requestReadPermission(): Promise { + return; + } }