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

iOS doesn't add foreground key #41

Closed
ashconnell opened this issue Jul 15, 2015 · 2 comments · Fixed by #44
Closed

iOS doesn't add foreground key #41

ashconnell opened this issue Jul 15, 2015 · 2 comments · Fixed by #44

Comments

@ashconnell
Copy link
Contributor

Android sets additionalData.foreground: true on notification data when the app is open. This is helpful because background notifications - in most apps - when tapped will go to a route... but if the app is open we will likely alert the user in a different manner instead of route them away from where they are.

Is this not 100% necessary for iOS too? Maybe i'm missing another way to achieve the same thing?

@ashconnell
Copy link
Contributor Author

I'm assuming that is what the isInline boolean is for?

I added this to notificationReceived:

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

Just above

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

And it seems to work well.

@lock
Copy link

lock bot commented Jun 5, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

2 participants