firebase notificator "Notification" field

jafar habibi2 years ago

Hello,

the firebase notificator for traccar uses "notification" filed for posting title and body of message.
when the app is in background in android based devices, the notification is delivered to system tray to display the body and title of received message.
I am developing an android app that I handle notifications in a "FirebaseMessagingService" . when the app is foreground the app works perfectly. but when the app is in the background , the raw message is delivered to system tray and FirebaseMessagingService is not called. also when the app is killed the notifications does not work. the workaround is to use "data" filed instead of "notification" filed in FirebaseNotificator.

https://stackoverflow.com/questions/37711082/how-to-handle-notification-when-app-in-background-in-firebase

Anton Tananaev2 years ago

This doesn't seem to be Traccar specific info. That's just how Firebase works.

jafar habibi2 years ago

I think it is good to have an option for user to choose whether use "notification" or "data" type while sending firebase messages