NativeScript/firebase

Android `showNotificationsWhenInForeground` not working

vallemar opened this issue · 4 comments

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

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

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

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

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.