Skip to content

Commit

Permalink
feat(local-notifications): add missing functions
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsogl committed Sep 18, 2018
1 parent 640da1b commit 10d222d
Showing 1 changed file with 65 additions and 48 deletions.
113 changes: 65 additions & 48 deletions src/@ionic-native/plugins/local-notifications/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>}
*/
@Cordova()
hasPermission(): Promise<boolean> {
return;
}

/**
* Request permission to show notifications if not already granted.
* @returns {Promise<boolean>}
*/
@Cordova()
requestPermission(): Promise<boolean> {
return;
}

/**
* Schedules a single or multiple notifications
* @param options {Notification | Array<ILocalNotification>} optional
Expand Down Expand Up @@ -570,59 +588,59 @@ export class LocalNotifications extends IonicNativePlugin {
}

/**
* Get all the notification ids
* @returns {Promise<Array<number>>}
* 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<boolean>}
*/
@Cordova()
getIds(): Promise<number[]> {
hasType(id: number, type: string): Promise<boolean> {
return;
}

/**
* Get the ids of triggered notifications
* @returns {Promise<Array<number>>}
* Get the type (triggered, scheduled) for the notification.
* @param {number} id The ID of the notification.
*/
@Cordova()
getTriggeredIds(): Promise<number[]> {
getType(id: number): Promise<boolean> {
return;
}

/**
* Get the ids of scheduled notifications
* @returns {Promise<Array<number>>} Returns a promise
* Get all the notification ids
* @returns {Promise<Array<number>>}
*/
@Cordova()
getScheduledIds(): Promise<number[]> {
getIds(): Promise<number[]> {
return;
}

/**
* Get a notification object
* @param notificationId {any} The id of the notification to get
* @returns {Promise<ILocalNotification>}
* Get the ids of scheduled notifications
* @returns {Promise<Array<number>>} Returns a promise
*/
@Cordova()
get(notificationId: any): Promise<ILocalNotification> {
getScheduledIds(): Promise<number[]> {
return;
}

/**
* Get a scheduled notification object
* @param notificationId {any} The id of the notification to get
* @returns {Promise<ILocalNotification>}
* Get the ids of triggered notifications
* @returns {Promise<Array<number>>}
*/
@Cordova()
getScheduled(notificationId: any): Promise<ILocalNotification> {
getTriggeredIds(): Promise<number[]> {
return;
}

/**
* Get a triggered notification object
* @param notificationId The id of the notification to get
* Get a notification object
* @param notificationId {any} The id of the notification to get
* @returns {Promise<ILocalNotification>}
*/
@Cordova()
getTriggered(notificationId: any): Promise<ILocalNotification> {
get(notificationId: any): Promise<ILocalNotification> {
return;
}

Expand All @@ -636,38 +654,22 @@ export class LocalNotifications extends IonicNativePlugin {
}

/**
* Get all scheduled notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllScheduled(): Promise<ILocalNotification[]> {
return;
}

/**
* Get all triggered notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllTriggered(): Promise<ILocalNotification[]> {
return;
}

/**
* Request permission to show notifications if not already granted.
* @returns {Promise<boolean>}
* Get a scheduled notification object
* @param notificationId {any} The id of the notification to get
* @returns {Promise<ILocalNotification>}
*/
@Cordova()
requestPermission(): Promise<boolean> {
getScheduled(notificationId: any): Promise<ILocalNotification> {
return;
}

/**
* Informs if the app has the permission to show notifications.
* @returns {Promise<boolean>}
* Get a triggered notification object
* @param notificationId The id of the notification to get
* @returns {Promise<ILocalNotification>}
*/
@Cordova()
hasPermission(): Promise<boolean> {
getTriggered(notificationId: any): Promise<ILocalNotification> {
return;
}

Expand All @@ -678,10 +680,7 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
addActions(
groupId: any,
actions: ILocalNotificationAction[]
): Promise<any> {
addActions(groupId: any, actions: ILocalNotificationAction[]): Promise<any> {
return;
}

Expand Down Expand Up @@ -727,6 +726,24 @@ export class LocalNotifications extends IonicNativePlugin {
return;
}

/**
* Get all scheduled notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllScheduled(): Promise<ILocalNotification[]> {
return;
}

/**
* Get all triggered notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllTriggered(): Promise<ILocalNotification[]> {
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
Expand Down

0 comments on commit 10d222d

Please sign in to comment.