Commit f6544e8b by Sebastián Katzer

All interfaces working except update() for iOS

parent 0fe90469
...@@ -39,41 +39,41 @@ ...@@ -39,41 +39,41 @@
- (void) schedule:(CDVInvokedUrlCommand*)command; - (void) schedule:(CDVInvokedUrlCommand*)command;
//// Update set of notifications //// Update set of notifications
//- (void) update:(CDVInvokedUrlCommand*)command; //- (void) update:(CDVInvokedUrlCommand*)command;
//// Cancel set of notifications // Clear notifications by id
//- (void) cancel:(CDVInvokedUrlCommand*)command; - (void) clear:(CDVInvokedUrlCommand*)command;
//// Cancel all notifications // Clear all notifications
//- (void) cancelAll:(CDVInvokedUrlCommand*)command; - (void) clearAll:(CDVInvokedUrlCommand*)command;
//// Clear set of notifications // Cancel notifications by id
//- (void) clear:(CDVInvokedUrlCommand*)command; - (void) cancel:(CDVInvokedUrlCommand*)command;
//// Clear all notifications // Cancel all notifications
//- (void) clearAll:(CDVInvokedUrlCommand*)command; - (void) cancelAll:(CDVInvokedUrlCommand*)command;
//
//// If a notification with an ID is present // If a notification with an ID is present
//- (void) isPresent:(CDVInvokedUrlCommand*)command; - (void) isPresent:(CDVInvokedUrlCommand*)command;
//// If a notification with an ID is scheduled // If a notification with an ID is scheduled
//- (void) isScheduled:(CDVInvokedUrlCommand*)command; - (void) isScheduled:(CDVInvokedUrlCommand*)command;
//// If a notification with an ID is triggered // If a notification with an ID is triggered
//- (void) isTriggered:(CDVInvokedUrlCommand*)command; - (void) isTriggered:(CDVInvokedUrlCommand*)command;
//
//// List all ids from all local notifications // List of all notification IDs
//- (void) getAllIds:(CDVInvokedUrlCommand*)command; - (void) ids:(CDVInvokedUrlCommand*)command;
//// List all ids from all pending notifications // List of all scheduled notification IDs
//- (void) getScheduledIds:(CDVInvokedUrlCommand*)command; - (void) scheduledIds:(CDVInvokedUrlCommand*)command;
//// List all ids from all triggered notifications // List of all triggered notification IDs
//- (void) getTriggeredIds:(CDVInvokedUrlCommand*)command; - (void) triggeredIds:(CDVInvokedUrlCommand*)command;
//
//// Propertys for given local notification // Notification by id
//- (void) getSingle:(CDVInvokedUrlCommand*)command; - (void) notification:(CDVInvokedUrlCommand*)command;
//// Propertya for given scheduled notification // Scheduled notification by id
//- (void) getSingleScheduled:(CDVInvokedUrlCommand*)command; - (void) scheduledNotification:(CDVInvokedUrlCommand*)command;
//// Propertys for given triggered notification // Triggered notification by id
//- (void) getSingleTriggered:(CDVInvokedUrlCommand*)command; - (void) triggeredNotification:(CDVInvokedUrlCommand*)command;
//
//// Property list for given local notifications // List of notifications by id
//- (void) getAll:(CDVInvokedUrlCommand*)command; - (void) notifications:(CDVInvokedUrlCommand*)command;
//// Property list for given scheduled notifications // List of scheduled notifications by id
//- (void) getScheduled:(CDVInvokedUrlCommand*)command; - (void) scheduledNotifications:(CDVInvokedUrlCommand*)command;
//// Property list for given triggered notifications // List of triggered notifications by id
//- (void) getTriggered:(CDVInvokedUrlCommand*)command; - (void) triggeredNotifications:(CDVInvokedUrlCommand*)command;
@end @end
...@@ -138,379 +138,338 @@ ...@@ -138,379 +138,338 @@
// [self execCallback:command]; // [self execCallback:command];
// }]; // }];
//} //}
//
///** /**
// * Cancel a set of notifications. * Clear notifications by id.
// * *
// * @param ids * @param [ Array<Int> ] The IDs of the notifications to clear.
// * The IDs of the notifications *
// */ * @return [ Void ]
//- (void) cancel:(CDVInvokedUrlCommand*)command */
//{ - (void) clear:(CDVInvokedUrlCommand*)command
// [self.commandDelegate runInBackground:^{ {
// if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"10.0")) { [self.commandDelegate runInBackground:^{
// for (NSNumber* id in command.arguments) { for (NSNumber* id in command.arguments) {
// UNNotificationRequest* notification; UNNotificationRequest* notification;
//
// notification = [self.center getNotificationWithId:id]; notification = [self.center getNotificationWithId:id];
//
// if (!notification) if (!notification)
// continue; continue;
//
// [self.center cancelNotification:notification]; [self.center clearNotification:notification];
// [self fireEvent:@"cancel" notification:notification]; [self fireEvent:@"clear" notification:notification];
// } }
// } else {
// for (NSNumber* id in command.arguments) { [self execCallback:command];
// UILocalNotification* notification; }];
// }
// notification = [self.app localNotificationWithId:id];
// /**
// if (!notification) * Clear all local notifications.
// continue; *
// * @return [ Void ]
// [self.app cancelLocalNotification:notification]; */
// [self fireEvent:@"cancel" localnotification:notification]; - (void) clearAll:(CDVInvokedUrlCommand*)command
// } {
// } [self.commandDelegate runInBackground:^{
// [self.center clearAllNotifications];
// [self execCallback:command]; [self.app setApplicationIconBadgeNumber:0];
// }]; [self fireEvent:@"clearall"];
//} [self execCallback:command];
// }];
///** }
// * Cancel all local notifications.
// */ /**
//- (void) cancelAll:(CDVInvokedUrlCommand*)command * Cancel notifications by id.
//{ *
// [self.commandDelegate runInBackground:^{ * @param [ Array<Int> ] The IDs of the notifications to clear.
// [self cancelAllNotifications]; *
// [self fireEvent:@"cancelall"]; * @return [ Void ]
// [self execCallback:command]; */
// }]; - (void) cancel:(CDVInvokedUrlCommand*)command
//} {
// [self.commandDelegate runInBackground:^{
///** for (NSNumber* id in command.arguments) {
// * Clear a set of notifications. UNNotificationRequest* notification;
// *
// * @param ids notification = [self.center getNotificationWithId:id];
// * The IDs of the notifications
// */ if (!notification)
//- (void) clear:(CDVInvokedUrlCommand*)command continue;
//{
// [self.commandDelegate runInBackground:^{ [self.center cancelNotification:notification];
// if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"10.0")) { [self fireEvent:@"cancel" notification:notification];
// for (NSNumber* id in command.arguments) { }
// UNNotificationRequest* notification;
// [self execCallback:command];
// notification = [self.center getNotificationWithId:id]; }];
// }
// if (!notification)
// continue; /**
// * Cancel all local notifications.
// [self.center clearNotification:notification]; *
// [self fireEvent:@"clear" notification:notification]; * @return [ Void ]
// } */
// } else { - (void) cancelAll:(CDVInvokedUrlCommand*)command
// for (NSNumber* id in command.arguments) { {
// UILocalNotification* notification; [self.commandDelegate runInBackground:^{
// [self.center cancelAllNotifications];
// notification = [self.app localNotificationWithId:id]; [self.app setApplicationIconBadgeNumber:0];
// [self fireEvent:@"cancelall"];
// if (!notification) [self execCallback:command];
// continue; }];
// }
// [self.app clearLocalNotification:notification];
// [self fireEvent:@"clear" localnotification:notification]; /**
// } * If a notification by ID is present.
// } *
// * @param [ Number ]id The ID of the notification.
// [self execCallback:command]; *
// }]; * @return [ Void ]
//} */
// - (void) isPresent:(CDVInvokedUrlCommand *)command
///** {
// * Clear all local notifications. [self exist:command byType:NotifcationTypeAll];
// */ }
//- (void) clearAll:(CDVInvokedUrlCommand*)command
//{ /**
// [self.commandDelegate runInBackground:^{ * If a notification by ID is scheduled.
// [self clearAllNotifications]; *
// [self fireEvent:@"clearall"]; * @param [ Number ]id The ID of the notification.
// [self execCallback:command]; *
// }]; * @return [ Void ]
//} */
// - (void) isScheduled:(CDVInvokedUrlCommand*)command
///** {
// * If a notification by ID is present. [self exist:command byType:NotifcationTypeScheduled];
// * }
// * @param id
// * The ID of the notification /**
// */ * Check if a notification with an ID is triggered.
//- (void) isPresent:(CDVInvokedUrlCommand *)command *
//{ * @param [ Number ]id The ID of the notification.
// [self isPresent:command type:NotifcationTypeAll]; *
//} * @return [ Void ]
// */
///** - (void) isTriggered:(CDVInvokedUrlCommand*)command
// * If a notification by ID is scheduled. {
// * [self exist:command byType:NotifcationTypeTriggered];
// * @param id }
// * The ID of the notification
// */ /**
//- (void) isScheduled:(CDVInvokedUrlCommand*)command * Check if a notification exists by ID and type.
//{ *
// [self isPresent:command type:NotifcationTypeScheduled]; * @param [ APPNotificationType ] type The type of notifications to look for.
//} *
// * @return [ Void ]
///** */
// * Check if a notification with an ID is triggered. - (void) exist:(CDVInvokedUrlCommand*)command
// * byType:(APPNotificationType)type;
// * @param id {
// * The ID of the notification [self.commandDelegate runInBackground:^{
// */ NSNumber* id = [command argumentAtIndex:0];
//- (void) isTriggered:(CDVInvokedUrlCommand*)command BOOL exist = [_center notificationExist:id type:type];
//{
// [self isPresent:command type:NotifcationTypeTriggered]; CDVPluginResult* result;
//} result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
// messageAsBool:exist];
///**
// * Check if a notification with an ID exists. [self.commandDelegate sendPluginResult:result
// * callbackId:command.callbackId];
// * @param type }];
// * The notification life cycle type }
// */
//- (void) isPresent:(CDVInvokedUrlCommand*)command /**
// type:(APPNotificationType)type; * List of all notification IDs.
//{ *
// [self.commandDelegate runInBackground:^{ * @return [ Void ]
// NSNumber* id = [command argumentAtIndex:0]; */
// BOOL exist; - (void) ids:(CDVInvokedUrlCommand*)command
// {
// if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"10.0")) { [self ids:command byType:NotifcationTypeAll];
// exist = [self.center notificationExist:id type:type]; }
// } else {
// if (type == NotifcationTypeAll) { /**
// exist = [self.app localNotificationExist:id]; * List of all scheduled notification IDs.
// } else { *
// exist = [self.app localNotificationExist:id type:type]; * @return [ Void ]
// } */
// } - (void) scheduledIds:(CDVInvokedUrlCommand*)command
// {
// CDVPluginResult* result; [self ids:command byType:NotifcationTypeScheduled];
// result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK }
// messageAsBool:exist];
// /**
// [self.commandDelegate sendPluginResult:result * List of all triggered notification IDs.
// callbackId:command.callbackId]; *
// }]; * @return [ Void ]
//} */
// - (void) triggeredIds:(CDVInvokedUrlCommand*)command
///** {
// * List all ids from all local notifications. [self ids:command byType:NotifcationTypeTriggered];
// */ }
//- (void) getAllIds:(CDVInvokedUrlCommand*)command
//{ /**
// [self getIds:command byType:NotifcationTypeAll]; * List of ids for given local notifications.
//} *
// * @param [ APPNotificationType ] type The type of notifications to look for.
///** *
// * List all ids from all pending notifications. * @return [ Void ]
// */ */
//- (void) getScheduledIds:(CDVInvokedUrlCommand*)command - (void) ids:(CDVInvokedUrlCommand*)command
//{ byType:(APPNotificationType)type;
// [self getIds:command byType:NotifcationTypeScheduled]; {
//} [self.commandDelegate runInBackground:^{
// NSArray* ids = [self.center getNotificationIdsByType:type];
///**
// * List all ids from all triggered notifications. CDVPluginResult* result;
// */ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
//- (void) getTriggeredIds:(CDVInvokedUrlCommand*)command messageAsArray:ids];
//{
// [self getIds:command byType:NotifcationTypeTriggered]; [self.commandDelegate sendPluginResult:result
//} callbackId:command.callbackId];
// }];
///** }
// * List of ids for given local notifications.
// * /**
// * @param type * Notification by id.
// * Notification life cycle type *
// * @param ids * @param [ Number ] id The id of the notification to return.
// * The IDs of the notifications *
// */ * @return [ Void ]
//- (void) getIds:(CDVInvokedUrlCommand*)command */
// byType:(APPNotificationType)type; - (void) notification:(CDVInvokedUrlCommand*)command
//{ {
// [self.commandDelegate runInBackground:^{ [self notification:command byType:NotifcationTypeAll];
// NSArray* ids; }
//
// if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"10.0")) { /**
// ids = [self.center getNotificationIdsByType:type]; * Scheduled notification by id.
// } else { *
// if (type == NotifcationTypeAll) { * @param [ Number ] id The id of the notification to return.
// ids = [self.app localNotificationIds]; *
// } else { * @return [ Void ]
// ids = [self.app localNotificationIdsByType:type]; */
// } - (void) scheduledNotification:(CDVInvokedUrlCommand*)command
// } {
// [self notification:command byType:NotifcationTypeScheduled];
// CDVPluginResult* result; }
// result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
// messageAsArray:ids]; /**
// * Triggered notification by id.
// [self.commandDelegate sendPluginResult:result *
// callbackId:command.callbackId]; * @param [ Number ] id The id of the notification to return.
// }]; *
//} * @return [ Void ]
// */
///** - (void) triggeredNotification:(CDVInvokedUrlCommand*)command
// * Propertys for given local notification. {
// */ [self notification:command byType:NotifcationTypeTriggered];
//- (void) getSingle:(CDVInvokedUrlCommand*)command }
//{
// [self getOption:command byType:NotifcationTypeAll]; /**
//} * Notification by type and id.
// *
///** * @param [ APPNotificationType ] type The type of notifications to look for.
// * Propertya for given scheduled notification. *
// */ * @return [ Void ]
//- (void) getSingleScheduled:(CDVInvokedUrlCommand*)command */
//{ - (void) notification:(CDVInvokedUrlCommand*)command
// [self getOption:command byType:NotifcationTypeScheduled]; byType:(APPNotificationType)type;
//} {
// [self.commandDelegate runInBackground:^{
//// Propertys for given triggered notification NSArray* ids = command.arguments;
//- (void) getSingleTriggered:(CDVInvokedUrlCommand*)command
//{ NSArray* notifications;
// [self getOption:command byType:NotifcationTypeTriggered]; notifications = [_center getNotificationOptionsByType:type andId:ids];
//}
// CDVPluginResult* result;
///** result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
// * Property list for given local notifications. messageAsDictionary:[notifications firstObject]];
// *
// * @param ids [self.commandDelegate sendPluginResult:result
// * The IDs of the notifications callbackId:command.callbackId];
// */ }];
//- (void) getAll:(CDVInvokedUrlCommand*)command }
//{
// [self getOptions:command byType:NotifcationTypeAll]; /**
//} * List of notifications by id.
// *
///** * @param [ Array<Number> ] ids The ids of the notifications to return.
// * Property list for given scheduled notifications. *
// * * @return [ Void ]
// * @param ids */
// * The IDs of the notifications - (void) notifications:(CDVInvokedUrlCommand*)command
// */ {
//- (void) getScheduled:(CDVInvokedUrlCommand*)command [self notifications:command byType:NotifcationTypeAll];
//{ }
// [self getOptions:command byType:NotifcationTypeScheduled];
//} /**
// * List of scheduled notifications by id.
///** *
// * Property list for given triggered notifications. * @param [ Array<Number> ] ids The ids of the notifications to return.
// * *
// * @param ids * @return [ Void ]
// * The IDs of the notifications */
// */ - (void) scheduledNotifications:(CDVInvokedUrlCommand*)command
//- (void) getTriggered:(CDVInvokedUrlCommand *)command {
//{ [self notifications:command byType:NotifcationTypeScheduled];
// [self getOptions:command byType:NotifcationTypeTriggered]; }
//}
// /**
///** * List of triggered notifications by id.
// * Propertys for given triggered notification. *
// * * @param [ Array<Number> ] ids The ids of the notifications to return.
// * @param type *
// * Notification life cycle type * @return [ Void ]
// * @param ids */
// * The ID of the notification - (void) triggeredNotifications:(CDVInvokedUrlCommand *)command
// */ {
//- (void) getOption:(CDVInvokedUrlCommand*)command [self notifications:command byType:NotifcationTypeTriggered];
// byType:(APPNotificationType)type; }
//{
// [self.commandDelegate runInBackground:^{ /**
// NSArray* ids = command.arguments; * List of notifications by type and id.
// NSArray* notifications; *
// * @param [ APPNotificationType ] type The type of notifications to look for.
// if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"10.0")) { *
// notifications = [self.center getNotificationOptionsByType:type * @return [ Void ]
// andId:ids]; */
// } else { - (void) notifications:(CDVInvokedUrlCommand*)command
// if (type == NotifcationTypeAll) { byType:(APPNotificationType)type;
// notifications = [self.app localNotificationOptionsById:ids]; {
// } [self.commandDelegate runInBackground:^{
// else { NSArray* ids = command.arguments;
// notifications = [self.app localNotificationOptionsByType:type NSArray* notifications;
// andId:ids];
// } if (type == NotifcationTypeAll && ids.count == 0) {
// } notifications = [_center getNotificationOptions];
// }
// CDVPluginResult* result; else if (type == NotifcationTypeAll) {
// result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK notifications = [_center getNotificationOptionsById:ids];
// messageAsDictionary:[notifications firstObject]]; }
// else if (ids.count == 0) {
// [self.commandDelegate sendPluginResult:result notifications = [_center getNotificationOptionsByType:type];
// callbackId:command.callbackId]; }
// }]; else {
//} notifications = [_center getNotificationOptionsByType:type
// andId:ids];
///** }
// * Property list for given triggered notifications.
// * CDVPluginResult* result;
// * @param type result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
// * Notification life cycle type messageAsArray:notifications];
// * @param ids
// * The IDs of the notifications [self.commandDelegate sendPluginResult:result
// */ callbackId:command.callbackId];
//- (void) getOptions:(CDVInvokedUrlCommand*)command }];
// byType:(APPNotificationType)type; }
//{
// [self.commandDelegate runInBackground:^{
// NSArray* ids = command.arguments;
// NSArray* notifications;
//
// if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"10.0")) {
// if (type == NotifcationTypeAll && ids.count == 0) {
// notifications = [self.center getNotificationOptions];
// }
// else if (type == NotifcationTypeAll) {
// notifications = [self.center getNotificationOptionsById:ids];
// }
// else if (ids.count == 0) {
// notifications = [self.center getNotificationOptionsByType:type];
// }
// else {
// notifications = [self.center getNotificationOptionsByType:type
// andId:ids];
// }
// } else {
// if (type == NotifcationTypeAll && ids.count == 0) {
// notifications = [self.app localNotificationOptions];
// }
// else if (type == NotifcationTypeAll) {
// notifications = [self.app localNotificationOptionsById:ids];
// }
// else if (ids.count == 0) {
// notifications = [self.app localNotificationOptionsByType:type];
// }
// else {
// notifications = [self.app localNotificationOptionsByType:type
// andId:ids];
// }
// }
//
// CDVPluginResult* result;
// result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
// messageAsArray:notifications];
//
// [self.commandDelegate sendPluginResult:result
// callbackId:command.callbackId];
// }];
//}
/** /**
* Check for permission to show notifications. * Check for permission to show notifications.
*
* @return [ Void ]
*/ */
- (void) check:(CDVInvokedUrlCommand*)command - (void) check:(CDVInvokedUrlCommand*)command
{ {
...@@ -530,6 +489,8 @@ ...@@ -530,6 +489,8 @@
/** /**
* Request for permission to show notifcations. * Request for permission to show notifcations.
*
* @return [ Void ]
*/ */
- (void) request:(CDVInvokedUrlCommand*)command - (void) request:(CDVInvokedUrlCommand*)command
{ {
...@@ -574,34 +535,6 @@ ...@@ -574,34 +535,6 @@
//// ////
//// [self scheduleLocalNotification:notification]; //// [self scheduleLocalNotification:notification];
//} //}
//
///**
// * Cancel all local notifications.
// */
//- (void) cancelAllNotifications
//{
// if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"10.0")) {
// [self.center cancelAllNotifications];
// } else {
// [self.app cancelAllLocalNotifications];
// }
//
// [self.app setApplicationIconBadgeNumber:0];
//}
//
///**
// * Clear all local notifications.
// */
//- (void) clearAllNotifications
//{
// if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"10.0")) {
// [self.center clearAllNotifications];
// } else {
// [self.app clearAllLocalNotifications];
// }
//
// [self.app setApplicationIconBadgeNumber:0];
//}
#pragma mark - #pragma mark -
#pragma mark UNUserNotificationCenterDelegate #pragma mark UNUserNotificationCenterDelegate
......
...@@ -125,288 +125,276 @@ exports.schedule = function (msgs, callback, scope, args) { ...@@ -125,288 +125,276 @@ exports.schedule = function (msgs, callback, scope, args) {
// } // }
// }; // };
// /** /**
// * Clear the specified notification. * Clear the specified notifications by id.
// * *
// * @param {String} id * @param [ Array<Int> ] ids The IDs of the notifications.
// * The ID of the notification * @param [ Function ] callback The function to be exec as the callback.
// * @param {Function} callback * @param [ Object ] scope The callback function's scope.
// * A function to be called after the notification has been cleared *
// * @param {Object?} scope * @return [ Void ]
// * The scope for the callback function */
// */ exports.clear = function (ids, callback, scope) {
// exports.clear = function (ids, callback, scope) { ids = Array.isArray(ids) ? ids : [ids];
// ids = Array.isArray(ids) ? ids : [ids]; ids = this.convertIds(ids);
// ids = this.convertIds(ids);
// this.exec('clear', ids, callback, scope);
// };
// /** this.exec('clear', ids, callback, scope);
// * Clear all previously sheduled notifications. };
// *
// * @param {Function} callback
// * A function to be called after all notifications have been cleared
// * @param {Object?} scope
// * The scope for the callback function
// */
// exports.clearAll = function (callback, scope) {
// this.exec('clearAll', null, callback, scope);
// };
// /** /**
// * Cancel the specified notifications. * Clear all triggered notifications.
// * *
// * @param {String[]} ids * @param [ Function ] callback The function to be exec as the callback.
// * The IDs of the notifications * @param [ Object ] scope The callback function's scope.
// * @param {Function} callback *
// * A function to be called after the notifications has been canceled * @return [ Void ]
// * @param {Object?} scope */
// * The scope for the callback function exports.clearAll = function (callback, scope) {
// */ this.exec('clearAll', null, callback, scope);
// exports.cancel = function (ids, callback, scope) { };
// ids = Array.isArray(ids) ? ids : [ids];
// ids = this.convertIds(ids);
// this.exec('cancel', ids, callback, scope); /**
// }; * Clear the specified notifications by id.
*
* @param [ Array<Int> ] ids The IDs of the notifications.
* @param [ Function ] callback The function to be exec as the callback.
* @param [ Object ] scope The callback function's scope.
*
* @return [ Void ]
*/
exports.cancel = function (ids, callback, scope) {
ids = Array.isArray(ids) ? ids : [ids];
ids = this.convertIds(ids);
// /** this.exec('cancel', ids, callback, scope);
// * Remove all previously registered notifications. };
// *
// * @param {Function} callback
// * A function to be called after all notifications have been canceled
// * @param {Object?} scope
// * The scope for the callback function
// */
// exports.cancelAll = function (callback, scope) {
// this.exec('cancelAll', null, callback, scope);
// };
// /** /**
// * Check if a notification with an ID is present. * Cancel all scheduled notifications.
// * *
// * @param {String} id * @param [ Function ] callback The function to be exec as the callback.
// * The ID of the notification * @param [ Object ] scope The callback function's scope.
// * @param {Function} callback *
// * A callback function to be called with the list * @return [ Void ]
// * @param {Object?} scope */
// * The scope for the callback function exports.cancelAll = function (callback, scope) {
// */ this.exec('cancelAll', null, callback, scope);
// exports.isPresent = function (id, callback, scope) { };
// this.exec('isPresent', id || 0, callback, scope);
// };
// /** /**
// * Check if a notification with an ID is scheduled. * Check if a notification is present.
// * *
// * @param {String} id * @param [ Int ] id The ID of the notification.
// * The ID of the notification * @param [ Function ] callback The function to be exec as the callback.
// * @param {Function} callback * @param [ Object ] scope The callback function's scope.
// * A callback function to be called with the list *
// * @param {Object?} scope * @return [ Void ]
// * The scope for the callback function */
// */ exports.isPresent = function (id, callback, scope) {
// exports.isScheduled = function (id, callback, scope) { this.exec('isPresent', id, callback, scope);
// this.exec('isScheduled', id || 0, callback, scope); };
// };
// /** /**
// * Check if a notification with an ID was triggered. * Check if a notification is scheduled.
// * *
// * @param {String} id * @param [ Int ] id The ID of the notification.
// * The ID of the notification * @param [ Function ] callback The function to be exec as the callback.
// * @param {Function} callback * @param [ Object ] scope The callback function's scope.
// * A callback function to be called with the list *
// * @param {Object?} scope * @return [ Void ]
// * The scope for the callback function */
// */ exports.isScheduled = function (id, callback, scope) {
// exports.isTriggered = function (id, callback, scope) { this.exec('isScheduled', id, callback, scope);
// this.exec('isTriggered', id || 0, callback, scope); };
// };
// * /**
// * List all local notification IDs. * Check if a notification was triggered.
// * *
// * @param {Function} callback * @param [ Int ] id The ID of the notification.
// * A callback function to be called with the list * @param [ Function ] callback The function to be exec as the callback.
// * @param {Object?} scope * @param [ Object ] scope The callback function's scope.
// * The scope for the callback function *
* @return [ Void ]
*/
exports.isTriggered = function (id, callback, scope) {
this.exec('isTriggered', id, callback, scope);
};
// exports.getAllIds = function (callback, scope) { /**
// this.exec('getAllIds', null, callback, scope); * List of all notification ids.
// }; *
* @param [ Function ] callback The function to be exec as the callback.
* @param [ Object ] scope The callback function's scope.
*
* @return [ Void ]
*/
exports.getAllIds = function (callback, scope) {
this.exec('ids', null, callback, scope);
};
// /** /**
// * Alias for `getAllIds`. * Alias for `getAllIds`.
// */ */
// exports.getIds = function () { exports.getIds = function () {
// this.getAllIds.apply(this, arguments); this.getAllIds.apply(this, arguments);
// }; };
// /** /**
// * List all scheduled notification IDs. * List of all scheduled notification IDs.
// * *
// * @param {Function} callback * @param [ Function ] callback The function to be exec as the callback.
// * A callback function to be called with the list * @param [ Object ] scope The callback function's scope.
// * @param {Object?} scope *
// * The scope for the callback function * @return [ Void ]
// */ */
// exports.getScheduledIds = function (callback, scope) { exports.getScheduledIds = function (callback, scope) {
// this.exec('getScheduledIds', null, callback, scope); this.exec('scheduledIds', null, callback, scope);
// }; };
// /** /**
// * List all triggered notification IDs. * List of all triggered notification IDs.
// * *
// * @param {Function} callback * @param [ Function ] callback The function to be exec as the callback.
// * A callback function to be called with the list * @param [ Object ] scope The callback function's scope.
// * @param {Object?} scope *
// * The scope for the callback function * @return [ Void ]
// */ */
// exports.getTriggeredIds = function (callback, scope) { exports.getTriggeredIds = function (callback, scope) {
// this.exec('getTriggeredIds', null, callback, scope); this.exec('triggeredIds', null, callback, scope);
// }; };
// /** /**
// * Property list for given local notifications. * List of local notifications specified by id.
// * If called without IDs, all notification will be returned. * If called without IDs, all notification will be returned.
// * *
// * @param {Number[]?} ids * @param [ Array<Int> ] ids The IDs of the notifications.
// * Set of notification IDs * @param [ Function ] callback The function to be exec as the callback.
// * @param {Function} callback * @param [ Object ] scope The callback function's scope.
// * A callback function to be called with the list *
// * @param {Object?} scope * @return [ Void ]
// * The scope for the callback function */
// */ exports.get = function () {
// exports.get = function () { var args = Array.apply(null, arguments);
// var args = Array.apply(null, arguments);
// if (typeof args[0] == 'function') { if (typeof args[0] == 'function') {
// args.unshift([]); args.unshift([]);
// } }
// var ids = args[0], var ids = args[0],
// callback = args[1], callback = args[1],
// scope = args[2]; scope = args[2];
// if (!Array.isArray(ids)) { if (!Array.isArray(ids)) {
// this.exec('getSingle', Number(ids), callback, scope); this.exec('notification', Number(ids), callback, scope);
// return; return;
// } }
// ids = this.convertIds(ids); ids = this.convertIds(ids);
// this.exec('getAll', ids, callback, scope); this.exec('notifications', ids, callback, scope);
// }; };
// /** /**
// * Property list for all local notifications. * List for all notifications.
// * *
// * @param {Function} callback * @param [ Function ] callback The function to be exec as the callback.
// * A callback function to be called with the list * @param [ Object ] scope The callback function's scope.
// * @param {Object?} scope *
// * The scope for the callback function * @return [ Void ]
// */ */
// exports.getAll = function (callback, scope) { exports.getAll = function (callback, scope) {
// this.exec('getAll', null, callback, scope); this.exec('notifications', null, callback, scope);
// }; };
// /** /**
// * Property list for given scheduled notifications. * List of scheduled notifications specified by id.
// * If called without IDs, all notification will be returned. * If called without IDs, all notification will be returned.
// * *
// * @param {Number[]?} ids * @param [ Array<Int> ] ids The IDs of the notifications.
// * Set of notification IDs * @param [ Function ] callback The function to be exec as the callback.
// * @param {Function} callback * @param [ Object ] scope The callback function's scope.
// * A callback function to be called with the list *
// * @param {Object?} scope * @return [ Void ]
// * The scope for the callback function */
// */ exports.getScheduled = function () {
// exports.getScheduled = function () { var args = Array.apply(null, arguments);
// var args = Array.apply(null, arguments);
// if (typeof args[0] == 'function') { if (typeof args[0] == 'function') {
// args.unshift([]); args.unshift([]);
// } }
// var ids = args[0], var ids = args[0],
// callback = args[1], callback = args[1],
// scope = args[2]; scope = args[2];
// if (!Array.isArray(ids)) { if (!Array.isArray(ids)) {
// ids = [ids]; ids = [ids];
// } }
// if (!Array.isArray(ids)) { if (!Array.isArray(ids)) {
// this.exec('getSingleScheduled', Number(ids), callback, scope); this.exec('scheduledNotification', Number(ids), callback, scope);
// return; return;
// } }
// ids = this.convertIds(ids); ids = this.convertIds(ids);
// this.exec('getScheduled', ids, callback, scope); this.exec('scheduledNotifications', ids, callback, scope);
// }; };
// /** /**
// * Property list for all scheduled notifications. * List of all scheduled notifications.
// * *
// * @param {Function} callback * @param [ Function ] callback The function to be exec as the callback.
// * A callback function to be called with the list * @param [ Object ] scope The callback function's scope.
// * @param {Object?} scope */
// * The scope for the callback function exports.getAllScheduled = function (callback, scope) {
// */ this.exec('scheduledNotifications', null, callback, scope);
// exports.getAllScheduled = function (callback, scope) { };
// this.exec('getScheduled', null, callback, scope);
// };
// /** /**
// * Property list for given triggered notifications. * List of triggered notifications specified by id.
// * If called without IDs, all notification will be returned. * If called without IDs, all notification will be returned.
// * *
// * @param {Number[]?} ids * @param [ Array<Int> ] ids The IDs of the notifications.
// * Set of notification IDs * @param [ Function ] callback The function to be exec as the callback.
// * @param {Function} callback * @param [ Object ] scope The callback function's scope.
// * A callback function to be called with the list *
// * @param {Object?} scope * @return [ Void ]
// * The scope for the callback function */
// */ exports.getTriggered = function () {
// exports.getTriggered = function () { var args = Array.apply(null, arguments);
// var args = Array.apply(null, arguments);
// if (typeof args[0] == 'function') { if (typeof args[0] == 'function') {
// args.unshift([]); args.unshift([]);
// } }
// var ids = args[0], var ids = args[0],
// callback = args[1], callback = args[1],
// scope = args[2]; scope = args[2];
// if (!Array.isArray(ids)) { if (!Array.isArray(ids)) {
// ids = [ids]; ids = [ids];
// } }
// if (!Array.isArray(ids)) { if (!Array.isArray(ids)) {
// this.exec('getSingleTriggered', Number(ids), callback, scope); this.exec('triggeredNotification', Number(ids), callback, scope);
// return; return;
// } }
// ids = this.convertIds(ids); ids = this.convertIds(ids);
// this.exec('getTriggered', ids, callback, scope); this.exec('triggeredNotifications', ids, callback, scope);
// }; };
// /** /**
// * Property list for all triggered notifications. * List of all triggered notifications.
// * *
// * @param {Function} callback * @param [ Function ] callback The function to be exec as the callback.
// * A callback function to be called with the list * @param [ Object ] scope The callback function's scope.
// * @param {Object?} scope */
// * The scope for the callback function exports.getAllTriggered = function (callback, scope) {
// */ this.exec('triggeredNotifications', null, callback, scope);
// exports.getAllTriggered = function (callback, scope) { };
// this.exec('getTriggered', null, callback, scope);
// };
/** /**
* The (platform specific) default settings. * The (platform specific) default settings.
......
...@@ -70,223 +70,211 @@ exports.schedule = function (notifications, callback, scope, args) { ...@@ -70,223 +70,211 @@ exports.schedule = function (notifications, callback, scope, args) {
// this.core.update(notifications, callback, scope, args); // this.core.update(notifications, callback, scope, args);
// }; // };
// /** /**
// * Clear the specified notification. * Clear the specified notifications by id.
// * *
// * @param {String} id * @param [ Array<Int> ] ids The IDs of the notifications.
// * The ID of the notification * @param [ Function ] callback The function to be exec as the callback.
// * @param {Function} callback * @param [ Object ] scope The callback function's scope.
// * A function to be called after the notification has been cleared *
// * @param {Object?} scope * @return [ Void ]
// * The scope for the callback function */
// */ exports.clear = function (ids, callback, scope) {
// exports.clear = function (ids, callback, scope) { this.core.clear(ids, callback, scope);
// this.core.clear(ids, callback, scope); };
// };
// /**
// * Clear all previously sheduled notifications.
// *
// * @param {Function} callback
// * A function to be called after all notifications have been cleared
// * @param {Object?} scope
// * The scope for the callback function
// */
// exports.clearAll = function (callback, scope) {
// this.core.clearAll(callback, scope);
// };
// /** /**
// * Cancel the specified notifications. * Clear all triggered notifications.
// * *
// * @param {String[]} ids * @param [ Function ] callback The function to be exec as the callback.
// * The IDs of the notifications * @param [ Object ] scope The callback function's scope.
// * @param {Function} callback *
// * A function to be called after the notifications has been canceled * @return [ Void ]
// * @param {Object?} scope */
// * The scope for the callback function exports.clearAll = function (callback, scope) {
// */ this.core.clearAll(callback, scope);
// exports.cancel = function (ids, callback, scope) { };
// this.core.cancel(ids, callback, scope);
// };
// /** /**
// * Remove all previously registered notifications. * Cancel the specified notifications by id.
// * *
// * @param {Function} callback * @param [ Array<Int> ] ids The IDs of the notifications.
// * A function to be called after all notifications have been canceled * @param [ Function ] callback The function to be exec as the callback.
// * @param {Object?} scope * @param [ Object ] scope The callback function's scope.
// * The scope for the callback function *
// */ * @return [ Void ]
// exports.cancelAll = function (callback, scope) { */
// this.core.cancelAll(callback, scope); exports.cancel = function (ids, callback, scope) {
// }; this.core.cancel(ids, callback, scope);
};
// /** /**
// * Check if a notification with an ID is present. * Cancel all scheduled notifications.
// * *
// * @param {String} id * @param [ Function ] callback The function to be exec as the callback.
// * The ID of the notification * @param [ Object ] scope The callback function's scope.
// * @param {Function} callback *
// * A callback function to be called with the list * @return [ Void ]
// * @param {Object?} scope */
// * The scope for the callback function exports.cancelAll = function (callback, scope) {
// */ this.core.cancelAll(callback, scope);
// exports.isPresent = function (id, callback, scope) { };
// this.core.isPresent(id, callback, scope);
// };
// /** /**
// * Check if a notification with an ID is scheduled. * Check if a notification is present.
// * *
// * @param {String} id * @param [ Int ] id The ID of the notification.
// * The ID of the notification * @param [ Function ] callback The function to be exec as the callback.
// * @param {Function} callback * @param [ Object ] scope The callback function's scope.
// * A callback function to be called with the list *
// * @param {Object?} scope * @return [ Void ]
// * The scope for the callback function */
// */ exports.isPresent = function (id, callback, scope) {
// exports.isScheduled = function (id, callback, scope) { this.core.isPresent(id, callback, scope);
// this.core.isScheduled(id, callback, scope); };
// };
// * /**
// * Check if a notification with an ID was triggered. * Check if a notification is scheduled.
// * *
// * @param {String} id * @param [ Int ] id The ID of the notification.
// * The ID of the notification * @param [ Function ] callback The function to be exec as the callback.
// * @param {Function} callback * @param [ Object ] scope The callback function's scope.
// * A callback function to be called with the list *
// * @param {Object?} scope * @return [ Void ]
// * The scope for the callback function */
exports.isScheduled = function (id, callback, scope) {
this.core.isScheduled(id, callback, scope);
};
// exports.isTriggered = function (id, callback, scope) { /**
// this.core.isTriggered(id, callback, scope); * Check if a notification was triggered.
// }; *
* @param [ Int ] id The ID of the notification.
* @param [ Function ] callback The function to be exec as the callback.
* @param [ Object ] scope The callback function's scope.
*
* @return [ Void ]
*/
exports.isTriggered = function (id, callback, scope) {
this.core.isTriggered(id, callback, scope);
};
// /** /**
// * List all local notification IDs. * List of all notification ids.
// * *
// * @param {Function} callback * @param [ Function ] callback The function to be exec as the callback.
// * A callback function to be called with the list * @param [ Object ] scope The callback function's scope.
// * @param {Object?} scope *
// * The scope for the callback function * @return [ Void ]
// */ */
// exports.getAllIds = function (callback, scope) { exports.getAllIds = function (callback, scope) {
// this.core.getAllIds(callback, scope); this.core.getAllIds(callback, scope);
// }; };
// /** /**
// * Alias for `getAllIds`. * Alias for `getAllIds`.
// */ */
// exports.getIds = function () { exports.getIds = function () {
// this.getAllIds.apply(this, arguments); this.getAllIds.apply(this, arguments);
// }; };
// /** /**
// * List all scheduled notification IDs. * List of all scheduled notification IDs.
// * *
// * @param {Function} callback * @param [ Function ] callback The function to be exec as the callback.
// * A callback function to be called with the list * @param [ Object ] scope The callback function's scope.
// * @param {Object?} scope *
// * The scope for the callback function * @return [ Void ]
// */ */
// exports.getScheduledIds = function (callback, scope) { exports.getScheduledIds = function (callback, scope) {
// this.core.getScheduledIds(callback, scope); this.core.getScheduledIds(callback, scope);
// }; };
// /** /**
// * List all triggered notification IDs. * List of all triggered notification IDs.
// * *
// * @param {Function} callback * @param [ Function ] callback The function to be exec as the callback.
// * A callback function to be called with the list * @param [ Object ] scope The callback function's scope.
// * @param {Object?} scope *
// * The scope for the callback function * @return [ Void ]
// */ */
// exports.getTriggeredIds = function (callback, scope) { exports.getTriggeredIds = function (callback, scope) {
// this.core.getTriggeredIds(callback, scope); this.core.getTriggeredIds(callback, scope);
// }; };
// /** /**
// * Property list for given local notifications. * List of local notifications specified by id.
// * If called without IDs, all notification will be returned. * If called without IDs, all notification will be returned.
// * *
// * @param {Number[]?} ids * @param [ Array<Int> ] ids The IDs of the notifications.
// * Set of notification IDs * @param [ Function ] callback The function to be exec as the callback.
// * @param {Function} callback * @param [ Object ] scope The callback function's scope.
// * A callback function to be called with the list *
// * @param {Object?} scope * @return [ Void ]
// * The scope for the callback function */
// */ exports.get = function (ids, callback, scope) {
// exports.get = function () { this.core.get(ids, callback, scope);
// this.core.get.apply(this.core, arguments); };
// };
// /** /**
// * Property list for all local notifications. * List for all notifications.
// * *
// * @param {Function} callback * @param [ Function ] callback The function to be exec as the callback.
// * A callback function to be called with the list * @param [ Object ] scope The callback function's scope.
// * @param {Object?} scope *
// * The scope for the callback function * @return [ Void ]
// */ */
// exports.getAll = function (callback, scope) { exports.getAll = function (callback, scope) {
// this.core.getAll(callback, scope); this.core.getAll(callback, scope);
// }; };
// /** /**
// * Property list for given scheduled notifications. * List of scheduled notifications specified by id.
// * If called without IDs, all notification will be returned. * If called without IDs, all notification will be returned.
// * *
// * @param {Number[]?} ids * @param [ Array<Int> ] ids The IDs of the notifications.
// * Set of notification IDs * @param [ Function ] callback The function to be exec as the callback.
// * @param {Function} callback * @param [ Object ] scope The callback function's scope.
// * A callback function to be called with the list *
// * @param {Object?} scope * @return [ Void ]
// * The scope for the callback function */
// */ exports.getScheduled = function (ids, callback, scope) {
// exports.getScheduled = function () { this.core.getScheduled(ids, callback, scope);
// this.core.getScheduled.apply(this.core, arguments); };
// };
// /** /**
// * Property list for all scheduled notifications. * List of all scheduled notifications.
// * *
// * @param {Function} callback * @param [ Function ] callback The function to be exec as the callback.
// * A callback function to be called with the list * @param [ Object ] scope The callback function's scope.
// * @param {Object?} scope */
// * The scope for the callback function exports.getAllScheduled = function (callback, scope) {
// */ this.core.getAllScheduled(callback, scope);
// exports.getAllScheduled = function (callback, scope) { };
// this.core.getAllScheduled(callback, scope);
// };
// /** /**
// * Property list for given triggered notifications. * List of triggered notifications specified by id.
// * If called without IDs, all notification will be returned. * If called without IDs, all notification will be returned.
// * *
// * @param {Number[]?} ids * @param [ Array<Int> ] ids The IDs of the notifications.
// * Set of notification IDs * @param [ Function ] callback The function to be exec as the callback.
// * @param {Function} callback * @param [ Object ] scope The callback function's scope.
// * A callback function to be called with the list *
// * @param {Object?} scope * @return [ Void ]
// * The scope for the callback function */
// */ exports.getTriggered = function (ids, callback, scope) {
// exports.getTriggered = function () { this.core.getTriggered(ids, callback, scope);
// this.core.getTriggered.apply(this.core, arguments); };
// };
// /** /**
// * Property list for all triggered notifications. * List of all triggered notifications.
// * *
// * @param {Function} callback * @param [ Function ] callback The function to be exec as the callback.
// * A callback function to be called with the list * @param [ Object ] scope The callback function's scope.
// * @param {Object?} scope */
// * The scope for the callback function exports.getAllTriggered = function (callback, scope) {
// */ this.core.getAllTriggered(callback, scope);
// exports.getAllTriggered = function (callback, scope) { };
// this.core.getAllTriggered(callback, scope);
// };
/** /**
* The (platform specific) default settings. * The (platform specific) default settings.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment