Commit afbf2c94 by Sebastián Katzer

Added `queued` flag to event payload

parent bcd62176
...@@ -629,8 +629,9 @@ ...@@ -629,8 +629,9 @@
NSString *js, *params, *notiAsJSON, *dataAsJSON; NSString *js, *params, *notiAsJSON, *dataAsJSON;
NSData* dataAsData; NSData* dataAsData;
[data setObject:event forKey:@"event"]; [data setObject:event forKey:@"event"];
[data setObject:@(isActive) forKey:@"foreground"]; [data setObject:@(isActive) forKey:@"foreground"];
[data setObject:@(!deviceready) forKey:@"queued"];
if (request) { if (request) {
notiAsJSON = [request encodeToJSON]; notiAsJSON = [request encodeToJSON];
......
...@@ -352,11 +352,11 @@ exports.clicked = function (xml, input) { ...@@ -352,11 +352,11 @@ exports.clicked = function (xml, input) {
* @return [ Void ] * @return [ Void ]
*/ */
exports.fireEvent = function (event, toast, data) { exports.fireEvent = function (event, toast, data) {
var meta = Object.assign({ event: event }, data), var meta = Object.assign({ event: event, queued: !ready }, data),
plugin = cordova.plugins.notification.local.core; plugin = cordova.plugins.notification.local.core;
if (!ready) { if (!ready) {
queue.push(arguments); queue.push([event, toast, meta]);
return; return;
} }
......
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