mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-27 21:41:25 +08:00
feat(local-notifications): add missing functions
This commit is contained in:
parent
640da1b618
commit
10d222dcea
@ -483,6 +483,24 @@ export interface ILocalNotification {
|
|||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class LocalNotifications extends IonicNativePlugin {
|
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
|
* Schedules a single or multiple notifications
|
||||||
* @param options {Notification | Array<ILocalNotification>} optional
|
* @param options {Notification | Array<ILocalNotification>} optional
|
||||||
@ -569,6 +587,26 @@ export class LocalNotifications extends IonicNativePlugin {
|
|||||||
return;
|
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<boolean>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
hasType(id: number, type: string): Promise<boolean> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the type (triggered, scheduled) for the notification.
|
||||||
|
* @param {number} id The ID of the notification.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getType(id: number): Promise<boolean> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all the notification ids
|
* Get all the notification ids
|
||||||
* @returns {Promise<Array<number>>}
|
* @returns {Promise<Array<number>>}
|
||||||
@ -578,15 +616,6 @@ export class LocalNotifications extends IonicNativePlugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the ids of triggered notifications
|
|
||||||
* @returns {Promise<Array<number>>}
|
|
||||||
*/
|
|
||||||
@Cordova()
|
|
||||||
getTriggeredIds(): Promise<number[]> {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the ids of scheduled notifications
|
* Get the ids of scheduled notifications
|
||||||
* @returns {Promise<Array<number>>} Returns a promise
|
* @returns {Promise<Array<number>>} Returns a promise
|
||||||
@ -596,6 +625,15 @@ export class LocalNotifications extends IonicNativePlugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the ids of triggered notifications
|
||||||
|
* @returns {Promise<Array<number>>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getTriggeredIds(): Promise<number[]> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a notification object
|
* Get a notification object
|
||||||
* @param notificationId {any} The id of the notification to get
|
* @param notificationId {any} The id of the notification to get
|
||||||
@ -606,6 +644,15 @@ export class LocalNotifications extends IonicNativePlugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all notification objects
|
||||||
|
* @returns {Promise<Array<ILocalNotification>>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getAll(): Promise<ILocalNotification[]> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a scheduled notification object
|
* Get a scheduled notification object
|
||||||
* @param notificationId {any} The id of the notification to get
|
* @param notificationId {any} The id of the notification to get
|
||||||
@ -626,51 +673,6 @@ export class LocalNotifications extends IonicNativePlugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all notification objects
|
|
||||||
* @returns {Promise<Array<ILocalNotification>>}
|
|
||||||
*/
|
|
||||||
@Cordova()
|
|
||||||
getAll(): Promise<ILocalNotification[]> {
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Request permission to show notifications if not already granted.
|
|
||||||
* @returns {Promise<boolean>}
|
|
||||||
*/
|
|
||||||
@Cordova()
|
|
||||||
requestPermission(): Promise<boolean> {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Informs if the app has the permission to show notifications.
|
|
||||||
* @returns {Promise<boolean>}
|
|
||||||
*/
|
|
||||||
@Cordova()
|
|
||||||
hasPermission(): Promise<boolean> {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a group of actions
|
* Adds a group of actions
|
||||||
* @param groupId The id of the action group
|
* @param groupId The id of the action group
|
||||||
@ -678,10 +680,7 @@ export class LocalNotifications extends IonicNativePlugin {
|
|||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
addActions(
|
addActions(groupId: any, actions: ILocalNotificationAction[]): Promise<any> {
|
||||||
groupId: any,
|
|
||||||
actions: ILocalNotificationAction[]
|
|
||||||
): Promise<any> {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -727,6 +726,24 @@ export class LocalNotifications extends IonicNativePlugin {
|
|||||||
return;
|
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
|
* 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
|
* @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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user