From 10d222dceaed6bf372bec4ebaba0080946048294 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 18 Sep 2018 15:37:39 +0200 Subject: [PATCH] feat(local-notifications): add missing functions --- .../plugins/local-notifications/index.ts | 133 ++++++++++-------- 1 file changed, 75 insertions(+), 58 deletions(-) diff --git a/src/@ionic-native/plugins/local-notifications/index.ts b/src/@ionic-native/plugins/local-notifications/index.ts index 38dbd7d5d..8e98036c8 100755 --- a/src/@ionic-native/plugins/local-notifications/index.ts +++ b/src/@ionic-native/plugins/local-notifications/index.ts @@ -483,6 +483,24 @@ export interface ILocalNotification { }) @Injectable() export class LocalNotifications extends IonicNativePlugin { + /** + * Informs if the app has the permission to show notifications. + * @returns {Promise} + */ + @Cordova() + hasPermission(): Promise { + return; + } + + /** + * Request permission to show notifications if not already granted. + * @returns {Promise} + */ + @Cordova() + requestPermission(): Promise { + return; + } + /** * Schedules a single or multiple notifications * @param options {Notification | Array} optional @@ -569,6 +587,26 @@ export class LocalNotifications extends IonicNativePlugin { return; } + /** + * Check if a notification has a given type. + * @param {number} id The ID of the notification. + * @param {string} type The type of the notification. + * @returns {Promise} + */ + @Cordova() + hasType(id: number, type: string): Promise { + return; + } + + /** + * Get the type (triggered, scheduled) for the notification. + * @param {number} id The ID of the notification. + */ + @Cordova() + getType(id: number): Promise { + return; + } + /** * Get all the notification ids * @returns {Promise>} @@ -578,15 +616,6 @@ export class LocalNotifications extends IonicNativePlugin { return; } - /** - * Get the ids of triggered notifications - * @returns {Promise>} - */ - @Cordova() - getTriggeredIds(): Promise { - return; - } - /** * Get the ids of scheduled notifications * @returns {Promise>} Returns a promise @@ -596,6 +625,15 @@ export class LocalNotifications extends IonicNativePlugin { return; } + /** + * Get the ids of triggered notifications + * @returns {Promise>} + */ + @Cordova() + getTriggeredIds(): Promise { + return; + } + /** * Get a notification object * @param notificationId {any} The id of the notification to get @@ -606,6 +644,15 @@ export class LocalNotifications extends IonicNativePlugin { return; } + /** + * Get all notification objects + * @returns {Promise>} + */ + @Cordova() + getAll(): Promise { + return; + } + /** * Get a scheduled notification object * @param notificationId {any} The id of the notification to get @@ -626,51 +673,6 @@ export class LocalNotifications extends IonicNativePlugin { return; } - /** - * Get all notification objects - * @returns {Promise>} - */ - @Cordova() - getAll(): Promise { - return; - } - - /** - * Get all scheduled notification objects - * @returns {Promise>} - */ - @Cordova() - getAllScheduled(): Promise { - return; - } - - /** - * Get all triggered notification objects - * @returns {Promise>} - */ - @Cordova() - getAllTriggered(): Promise { - return; - } - - /** - * Request permission to show notifications if not already granted. - * @returns {Promise} - */ - @Cordova() - requestPermission(): Promise { - return; - } - - /** - * Informs if the app has the permission to show notifications. - * @returns {Promise} - */ - @Cordova() - hasPermission(): Promise { - return; - } - /** * Adds a group of actions * @param groupId The id of the action group @@ -678,10 +680,7 @@ export class LocalNotifications extends IonicNativePlugin { * @returns {Promise} */ @Cordova() - addActions( - groupId: any, - actions: ILocalNotificationAction[] - ): Promise { + addActions(groupId: any, actions: ILocalNotificationAction[]): Promise { return; } @@ -727,6 +726,24 @@ export class LocalNotifications extends IonicNativePlugin { return; } + /** + * Get all scheduled notification objects + * @returns {Promise>} + */ + @Cordova() + getAllScheduled(): Promise { + return; + } + + /** + * Get all triggered notification objects + * @returns {Promise>} + */ + @Cordova() + getAllTriggered(): Promise { + return; + } + /** * Sets a callback for a specific event * @param eventName {string} The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall. Custom event names are possible for actions