Skip to content

Commit

Permalink
reset incoming push data after getIncoming is called
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-scig committed Dec 7, 2012
1 parent 998285b commit 1112b76
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ public PluginResult execute(String action, JSONArray data, String callbackId) {
Map<String, String> extras = PushNotificationPlugin.incomingExtras;
JSONObject obj = notificationObject(alert, extras);
result = new PluginResult(Status.OK, obj);
//reset incoming push data until the next background push comes in
PushNotificationPlugin.incomingAlert = "";
PushNotificationPlugin.incomingExtras = new HashMap<String,String>();
} else if (action.equals("getPushID")) {
String pushID = PushManager.shared().getAPID();
pushID = pushID != null ? pushID : "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ - (void)getIncoming:(NSMutableArray *)args withDict:(NSMutableDictionary *)optio

[returnDictionary setObject:incomingAlert forKey:@"message"];
[returnDictionary setObject:incomingExtras forKey:@"extras"];

//reset incoming push data until the next background push comes in
[[UAAppDelegateSurrogate shared] clearLaunchOptions];

return returnDictionary;
}];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ SINGLETON_INTERFACE(UAAppDelegateSurrogate);
@property(nonatomic, assign) NSObject<UIApplicationDelegate> *defaultAppDelegate;
@property(nonatomic, readonly, copy) NSDictionary *launchOptions;

- (void)clearLaunchOptions;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ initial delegate does appear to be released (deallocated) when a new delegate
[UAPush setDefaultPushEnabledValue:NO];
}

- (void)clearLaunchOptions {
self.launchOptions = nil;
}

#pragma mark Message forwarding

- (void)forwardInvocation:(NSInvocation *)invocation {
Expand Down

0 comments on commit 1112b76

Please sign in to comment.