Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #44 from Deminetix/issue41
Browse files Browse the repository at this point in the history
fix issue #41
  • Loading branch information
macdonst committed Jul 20, 2015
2 parents 26c9c59 + 24967b9 commit f79bd8d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Callback Parameter | Description
`data.sound` | `String` The name of the sound file to be played upon receipt of the notification.
`data.image (windows only)` | `String` The path of the image file to be displayed in the notification.
`data.additionalData` | `JSON Object` An optional collection of data sent by the 3rd party push service that does not fit in the above properties.
`data.additionalData.foreground` | `Boolean` Whether the notification was received while the app was in the foreground

#### Example

Expand Down
2 changes: 1 addition & 1 deletion src/ios/AppDelegate+notification.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ - (void)applicationDidBecomeActive:(UIApplication *)application {

if (self.launchNotification) {
PushPlugin *pushHandler = [self getCommandInstance:@"PushNotification"];

pushHandler.isInline = NO;
pushHandler.notificationMessage = self.launchNotification;
self.launchNotification = nil;
[pushHandler performSelectorOnMainThread:@selector(notificationReceived) withObject:pushHandler waitUntilDone:NO];
Expand Down
4 changes: 4 additions & 0 deletions src/ios/PushPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ - (void)notificationReceived {
[additionalData setObject:[notificationMessage objectForKey:key] forKey:key];
}
}

if (isInline) {
[additionalData setObject:[NSNumber numberWithBool:YES] forKey:@"foreground"];
}

[message setObject:additionalData forKey:@"additionalData"];

Expand Down

0 comments on commit f79bd8d

Please sign in to comment.