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

Android showNotificationsWhenInForeground not working #191

Open
vallemar opened this issue Mar 26, 2023 · 4 comments
Open

Android showNotificationsWhenInForeground not working #191

vallemar opened this issue Mar 26, 2023 · 4 comments

Comments

@vallemar
Copy link
Contributor

In android when i set showNotificationsWhenInForeground to true the app doesn't show the notification if it is in the foreground

firebase().messaging().showNotificationsWhenInForeground = true;

https://github.com/NativeScript/firebase/blob/main/packages/firebase-messaging/README.md#always-show-notifications-when-the-application-is-in-foreground

@jskorlol
Copy link

I guess this issue is still not resolved, is that correct?

@SingleMalted
Copy link

SingleMalted commented Jul 1, 2024

I've been using local-notifications as a workaround for this for a while now.

@jskorlol
Copy link

jskorlol commented Jul 5, 2024

@SingleMalted
So you solved it by displaying a message using local-notifications when receiving a message via messaging.onMessage in firebase?

@SingleMalted
Copy link

yep, basically. It checks that the app is in the foreground and is Android. If so, it schedules a local notification.

It's not ideal but it works well enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants