Android Question Firebase Notification not opens app

Hari Haran

Member
Licensed User
Hi All,

I am trying with FCM notification and it works fine when the app is in foreground and getting the DATA in the FirebaseMessaging Service, and app is open when the click the notification generated by the application, but once the app is in background , app receives the notification in system tray but when Click the notification the app is not opened ,
I tried with both Topics also with by sending to particular deviceid , both have the same effect.



So can anyone guide me as i was stuck up here

Thanking you

with regards
Hari Haran C
 

Hari Haran

Member
Licensed User
Ya got it Erel, Thanks and I have found the issue.

We should not use the notification section in the json payload, as it overrides the data,
so now I removed the notification part and have only data section and now it works as desired ( When click the notification the app opens ).

not working format:
{"to":"cTQv5wwM......","notification":{"title":"Your title","body":"your body1"},"data":{"Name":"Michael","Age":"36"}}'

Working format:
{"to":"cTQv5wwM......","data":{"title":"your title","body":"your body1","Name":"Michael","Age":"36"}}

Hari Haran C
 
Upvote 0
Top