|
|
@@ -125,288 +125,276 @@ exports.schedule = function (msgs, callback, scope, args) {
|
|
|
// }
|
|
|
// };
|
|
|
|
|
|
-// /**
|
|
|
-// * Clear the specified notification.
|
|
|
-// *
|
|
|
-// * @param {String} id
|
|
|
-// * The ID of the notification
|
|
|
-// * @param {Function} callback
|
|
|
-// * A function to be called after the notification has been cleared
|
|
|
-// * @param {Object?} scope
|
|
|
-// * The scope for the callback function
|
|
|
-// */
|
|
|
-// exports.clear = function (ids, callback, scope) {
|
|
|
-// ids = Array.isArray(ids) ? ids : [ids];
|
|
|
-// ids = this.convertIds(ids);
|
|
|
-
|
|
|
-// this.exec('clear', 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.clear = function (ids, callback, scope) {
|
|
|
+ ids = Array.isArray(ids) ? ids : [ids];
|
|
|
+ ids = this.convertIds(ids);
|
|
|
|
|
|
-// /**
|
|
|
-// * 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);
|
|
|
-// };
|
|
|
+ this.exec('clear', ids, callback, scope);
|
|
|
+};
|
|
|
|
|
|
-// /**
|
|
|
-// * Cancel the specified notifications.
|
|
|
-// *
|
|
|
-// * @param {String[]} ids
|
|
|
-// * The IDs of the notifications
|
|
|
-// * @param {Function} callback
|
|
|
-// * A function to be called after the notifications has been canceled
|
|
|
-// * @param {Object?} scope
|
|
|
-// * The scope for the callback function
|
|
|
-// */
|
|
|
-// exports.cancel = function (ids, callback, scope) {
|
|
|
-// ids = Array.isArray(ids) ? ids : [ids];
|
|
|
-// ids = this.convertIds(ids);
|
|
|
+/**
|
|
|
+ * Clear all triggered notifications.
|
|
|
+ *
|
|
|
+ * @param [ Function ] callback The function to be exec as the callback.
|
|
|
+ * @param [ Object ] scope The callback function's scope.
|
|
|
+ *
|
|
|
+ * @return [ Void ]
|
|
|
+ */
|
|
|
+exports.clearAll = function (callback, scope) {
|
|
|
+ this.exec('clearAll', null, callback, scope);
|
|
|
+};
|
|
|
|
|
|
-// 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);
|
|
|
|
|
|
-// /**
|
|
|
-// * 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);
|
|
|
-// };
|
|
|
+ this.exec('cancel', ids, callback, scope);
|
|
|
+};
|
|
|
|
|
|
-// /**
|
|
|
-// * Check if a notification with an ID is present.
|
|
|
-// *
|
|
|
-// * @param {String} id
|
|
|
-// * The ID of the notification
|
|
|
-// * @param {Function} callback
|
|
|
-// * A callback function to be called with the list
|
|
|
-// * @param {Object?} scope
|
|
|
-// * The scope for the callback function
|
|
|
-// */
|
|
|
-// exports.isPresent = function (id, callback, scope) {
|
|
|
-// this.exec('isPresent', id || 0, callback, scope);
|
|
|
-// };
|
|
|
+/**
|
|
|
+ * Cancel all scheduled notifications.
|
|
|
+ *
|
|
|
+ * @param [ Function ] callback The function to be exec as the callback.
|
|
|
+ * @param [ Object ] scope The callback function's scope.
|
|
|
+ *
|
|
|
+ * @return [ Void ]
|
|
|
+ */
|
|
|
+exports.cancelAll = function (callback, scope) {
|
|
|
+ this.exec('cancelAll', null, callback, scope);
|
|
|
+};
|
|
|
|
|
|
-// /**
|
|
|
-// * Check if a notification with an ID is scheduled.
|
|
|
-// *
|
|
|
-// * @param {String} id
|
|
|
-// * The ID of the notification
|
|
|
-// * @param {Function} callback
|
|
|
-// * A callback function to be called with the list
|
|
|
-// * @param {Object?} scope
|
|
|
-// * The scope for the callback function
|
|
|
-// */
|
|
|
-// exports.isScheduled = function (id, callback, scope) {
|
|
|
-// this.exec('isScheduled', id || 0, callback, scope);
|
|
|
-// };
|
|
|
+/**
|
|
|
+ * Check if a notification is present.
|
|
|
+ *
|
|
|
+ * @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.isPresent = function (id, callback, scope) {
|
|
|
+ this.exec('isPresent', id, callback, scope);
|
|
|
+};
|
|
|
|
|
|
-// /**
|
|
|
-// * Check if a notification with an ID was triggered.
|
|
|
-// *
|
|
|
-// * @param {String} id
|
|
|
-// * The ID of the notification
|
|
|
-// * @param {Function} callback
|
|
|
-// * A callback function to be called with the list
|
|
|
-// * @param {Object?} scope
|
|
|
-// * The scope for the callback function
|
|
|
-// */
|
|
|
-// exports.isTriggered = function (id, callback, scope) {
|
|
|
-// this.exec('isTriggered', id || 0, callback, scope);
|
|
|
-// };
|
|
|
+/**
|
|
|
+ * Check if a notification is scheduled.
|
|
|
+ *
|
|
|
+ * @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.isScheduled = function (id, callback, scope) {
|
|
|
+ this.exec('isScheduled', id, callback, scope);
|
|
|
+};
|
|
|
|
|
|
-// *
|
|
|
-// * List all local notification IDs.
|
|
|
-// *
|
|
|
-// * @param {Function} callback
|
|
|
-// * A callback function to be called with the list
|
|
|
-// * @param {Object?} scope
|
|
|
-// * The scope for the callback function
|
|
|
+/**
|
|
|
+ * 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.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`.
|
|
|
-// */
|
|
|
-// exports.getIds = function () {
|
|
|
-// this.getAllIds.apply(this, arguments);
|
|
|
-// };
|
|
|
+/**
|
|
|
+ * Alias for `getAllIds`.
|
|
|
+ */
|
|
|
+exports.getIds = function () {
|
|
|
+ this.getAllIds.apply(this, arguments);
|
|
|
+};
|
|
|
|
|
|
-// /**
|
|
|
-// * List all scheduled notification IDs.
|
|
|
-// *
|
|
|
-// * @param {Function} callback
|
|
|
-// * A callback function to be called with the list
|
|
|
-// * @param {Object?} scope
|
|
|
-// * The scope for the callback function
|
|
|
-// */
|
|
|
-// exports.getScheduledIds = function (callback, scope) {
|
|
|
-// this.exec('getScheduledIds', null, callback, scope);
|
|
|
-// };
|
|
|
+/**
|
|
|
+ * List of all scheduled notification IDs.
|
|
|
+ *
|
|
|
+ * @param [ Function ] callback The function to be exec as the callback.
|
|
|
+ * @param [ Object ] scope The callback function's scope.
|
|
|
+ *
|
|
|
+ * @return [ Void ]
|
|
|
+ */
|
|
|
+exports.getScheduledIds = function (callback, scope) {
|
|
|
+ this.exec('scheduledIds', null, callback, scope);
|
|
|
+};
|
|
|
|
|
|
-// /**
|
|
|
-// * List all triggered notification IDs.
|
|
|
-// *
|
|
|
-// * @param {Function} callback
|
|
|
-// * A callback function to be called with the list
|
|
|
-// * @param {Object?} scope
|
|
|
-// * The scope for the callback function
|
|
|
-// */
|
|
|
-// exports.getTriggeredIds = function (callback, scope) {
|
|
|
-// this.exec('getTriggeredIds', null, callback, scope);
|
|
|
-// };
|
|
|
+/**
|
|
|
+ * List of all triggered notification IDs.
|
|
|
+ *
|
|
|
+ * @param [ Function ] callback The function to be exec as the callback.
|
|
|
+ * @param [ Object ] scope The callback function's scope.
|
|
|
+ *
|
|
|
+ * @return [ Void ]
|
|
|
+ */
|
|
|
+exports.getTriggeredIds = function (callback, scope) {
|
|
|
+ this.exec('triggeredIds', null, callback, scope);
|
|
|
+};
|
|
|
|
|
|
-// /**
|
|
|
-// * Property list for given local notifications.
|
|
|
-// * If called without IDs, all notification will be returned.
|
|
|
-// *
|
|
|
-// * @param {Number[]?} ids
|
|
|
-// * Set of notification IDs
|
|
|
-// * @param {Function} callback
|
|
|
-// * A callback function to be called with the list
|
|
|
-// * @param {Object?} scope
|
|
|
-// * The scope for the callback function
|
|
|
-// */
|
|
|
-// exports.get = function () {
|
|
|
-// var args = Array.apply(null, arguments);
|
|
|
+/**
|
|
|
+ * List of local notifications specified by id.
|
|
|
+ * If called without IDs, all notification will be returned.
|
|
|
+ *
|
|
|
+ * @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.get = function () {
|
|
|
+ var args = Array.apply(null, arguments);
|
|
|
|
|
|
-// if (typeof args[0] == 'function') {
|
|
|
-// args.unshift([]);
|
|
|
-// }
|
|
|
+ if (typeof args[0] == 'function') {
|
|
|
+ args.unshift([]);
|
|
|
+ }
|
|
|
|
|
|
-// var ids = args[0],
|
|
|
-// callback = args[1],
|
|
|
-// scope = args[2];
|
|
|
+ var ids = args[0],
|
|
|
+ callback = args[1],
|
|
|
+ scope = args[2];
|
|
|
|
|
|
-// if (!Array.isArray(ids)) {
|
|
|
-// this.exec('getSingle', Number(ids), callback, scope);
|
|
|
-// return;
|
|
|
-// }
|
|
|
+ if (!Array.isArray(ids)) {
|
|
|
+ this.exec('notification', Number(ids), callback, scope);
|
|
|
+ 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.
|
|
|
-// *
|
|
|
-// * @param {Function} callback
|
|
|
-// * A callback function to be called with the list
|
|
|
-// * @param {Object?} scope
|
|
|
-// * The scope for the callback function
|
|
|
-// */
|
|
|
-// exports.getAll = function (callback, scope) {
|
|
|
-// this.exec('getAll', null, callback, scope);
|
|
|
-// };
|
|
|
+/**
|
|
|
+ * List for all notifications.
|
|
|
+ *
|
|
|
+ * @param [ Function ] callback The function to be exec as the callback.
|
|
|
+ * @param [ Object ] scope The callback function's scope.
|
|
|
+ *
|
|
|
+ * @return [ Void ]
|
|
|
+ */
|
|
|
+exports.getAll = function (callback, scope) {
|
|
|
+ this.exec('notifications', null, callback, scope);
|
|
|
+};
|
|
|
|
|
|
-// /**
|
|
|
-// * Property list for given scheduled notifications.
|
|
|
-// * If called without IDs, all notification will be returned.
|
|
|
-// *
|
|
|
-// * @param {Number[]?} ids
|
|
|
-// * Set of notification IDs
|
|
|
-// * @param {Function} callback
|
|
|
-// * A callback function to be called with the list
|
|
|
-// * @param {Object?} scope
|
|
|
-// * The scope for the callback function
|
|
|
-// */
|
|
|
-// exports.getScheduled = function () {
|
|
|
-// var args = Array.apply(null, arguments);
|
|
|
+/**
|
|
|
+ * List of scheduled notifications specified by id.
|
|
|
+ * If called without IDs, all notification will be returned.
|
|
|
+ *
|
|
|
+ * @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.getScheduled = function () {
|
|
|
+ var args = Array.apply(null, arguments);
|
|
|
|
|
|
-// if (typeof args[0] == 'function') {
|
|
|
-// args.unshift([]);
|
|
|
-// }
|
|
|
+ if (typeof args[0] == 'function') {
|
|
|
+ args.unshift([]);
|
|
|
+ }
|
|
|
|
|
|
-// var ids = args[0],
|
|
|
-// callback = args[1],
|
|
|
-// scope = args[2];
|
|
|
+ var ids = args[0],
|
|
|
+ callback = args[1],
|
|
|
+ scope = args[2];
|
|
|
|
|
|
-// if (!Array.isArray(ids)) {
|
|
|
-// ids = [ids];
|
|
|
-// }
|
|
|
+ if (!Array.isArray(ids)) {
|
|
|
+ ids = [ids];
|
|
|
+ }
|
|
|
|
|
|
-// if (!Array.isArray(ids)) {
|
|
|
-// this.exec('getSingleScheduled', Number(ids), callback, scope);
|
|
|
-// return;
|
|
|
-// }
|
|
|
+ if (!Array.isArray(ids)) {
|
|
|
+ this.exec('scheduledNotification', Number(ids), callback, scope);
|
|
|
+ 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.
|
|
|
-// *
|
|
|
-// * @param {Function} callback
|
|
|
-// * A callback function to be called with the list
|
|
|
-// * @param {Object?} scope
|
|
|
-// * The scope for the callback function
|
|
|
-// */
|
|
|
-// exports.getAllScheduled = function (callback, scope) {
|
|
|
-// this.exec('getScheduled', null, callback, scope);
|
|
|
-// };
|
|
|
+/**
|
|
|
+ * List of all scheduled notifications.
|
|
|
+ *
|
|
|
+ * @param [ Function ] callback The function to be exec as the callback.
|
|
|
+ * @param [ Object ] scope The callback function's scope.
|
|
|
+ */
|
|
|
+exports.getAllScheduled = function (callback, scope) {
|
|
|
+ this.exec('scheduledNotifications', null, callback, scope);
|
|
|
+};
|
|
|
|
|
|
-// /**
|
|
|
-// * Property list for given triggered notifications.
|
|
|
-// * If called without IDs, all notification will be returned.
|
|
|
-// *
|
|
|
-// * @param {Number[]?} ids
|
|
|
-// * Set of notification IDs
|
|
|
-// * @param {Function} callback
|
|
|
-// * A callback function to be called with the list
|
|
|
-// * @param {Object?} scope
|
|
|
-// * The scope for the callback function
|
|
|
-// */
|
|
|
-// exports.getTriggered = function () {
|
|
|
-// var args = Array.apply(null, arguments);
|
|
|
+/**
|
|
|
+ * List of triggered notifications specified by id.
|
|
|
+ * If called without IDs, all notification will be returned.
|
|
|
+ *
|
|
|
+ * @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.getTriggered = function () {
|
|
|
+ var args = Array.apply(null, arguments);
|
|
|
|
|
|
-// if (typeof args[0] == 'function') {
|
|
|
-// args.unshift([]);
|
|
|
-// }
|
|
|
+ if (typeof args[0] == 'function') {
|
|
|
+ args.unshift([]);
|
|
|
+ }
|
|
|
|
|
|
-// var ids = args[0],
|
|
|
-// callback = args[1],
|
|
|
-// scope = args[2];
|
|
|
+ var ids = args[0],
|
|
|
+ callback = args[1],
|
|
|
+ scope = args[2];
|
|
|
|
|
|
-// if (!Array.isArray(ids)) {
|
|
|
-// ids = [ids];
|
|
|
-// }
|
|
|
+ if (!Array.isArray(ids)) {
|
|
|
+ ids = [ids];
|
|
|
+ }
|
|
|
|
|
|
-// if (!Array.isArray(ids)) {
|
|
|
-// this.exec('getSingleTriggered', Number(ids), callback, scope);
|
|
|
-// return;
|
|
|
-// }
|
|
|
+ if (!Array.isArray(ids)) {
|
|
|
+ this.exec('triggeredNotification', Number(ids), callback, scope);
|
|
|
+ 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.
|
|
|
-// *
|
|
|
-// * @param {Function} callback
|
|
|
-// * A callback function to be called with the list
|
|
|
-// * @param {Object?} scope
|
|
|
-// * The scope for the callback function
|
|
|
-// */
|
|
|
-// exports.getAllTriggered = function (callback, scope) {
|
|
|
-// this.exec('getTriggered', null, callback, scope);
|
|
|
-// };
|
|
|
+/**
|
|
|
+ * List of all triggered notifications.
|
|
|
+ *
|
|
|
+ * @param [ Function ] callback The function to be exec as the callback.
|
|
|
+ * @param [ Object ] scope The callback function's scope.
|
|
|
+ */
|
|
|
+exports.getAllTriggered = function (callback, scope) {
|
|
|
+ this.exec('triggeredNotifications', null, callback, scope);
|
|
|
+};
|
|
|
|
|
|
/**
|
|
|
* The (platform specific) default settings.
|