Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[firebase-messaging] Missing 'foreground' property in onMessage callback on Android #182

Open
prestopasto opened this issue Feb 9, 2023 · 1 comment
Labels
android enhancement New feature or request

Comments

@prestopasto
Copy link
Contributor

prestopasto commented Feb 9, 2023

In many instances it is desirable to handle notifications differently depending on if the message was received while the app is in the foreground vs when it is in the background. There is currently no way to determine this right now.

The old Firebase plugin by Eddy had a 'foreground' boolean property to accomplish this. Then in the 'onMessage' callback you could decide how to handle it.

https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/master/docs/MESSAGING.md

@triniwiz triniwiz added enhancement New feature or request android labels Feb 9, 2023
@vallemar
Copy link
Contributor

vallemar commented Apr 6, 2023

@prestopasto now you can use MessagingCore.inForeground for manage this

https://github.com/NativeScript/firebase/blob/main/packages/firebase-messaging/README.md#foreground-state-messages

Added in this PR #193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants