NativeScript / firebase

Modular Firebase 🔥 implementation for NativeScript. Supports both iOS & Android platforms for all Firebase services.
https://docs.nativescript.org/plugins/firebase-core.html
Apache License 2.0
54 stars 48 forks source link

Android `showNotificationsWhenInForeground` not working #191

Open vallemar opened 1 year ago

vallemar commented 1 year ago

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 commented 2 months ago

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

SingleMalted commented 2 months ago

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

jskorlol commented 1 month ago

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

SingleMalted commented 1 month ago

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.