H Hari Haran Member Licensed User Oct 5, 2021 #1 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
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
Erel B4X founder Staff member Licensed User Longtime User Oct 5, 2021 #2 Are you using the B4J program to send the messages? Upvote 0
H Hari Haran Member Licensed User Oct 6, 2021 #3 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 ). Code: Copy {"to":"cTQv5wwM......","notification":{"title":"Your title","body":"your body1"},"data":{"Name":"Michael","Age":"36"}}' Code: Copy {"to":"cTQv5wwM......","data":{"title":"your title","body":"your body1","Name":"Michael","Age":"36"}} Hari Haran C Upvote 0
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 ). Code: Copy {"to":"cTQv5wwM......","notification":{"title":"Your title","body":"your body1"},"data":{"Name":"Michael","Age":"36"}}' Code: Copy {"to":"cTQv5wwM......","data":{"title":"your title","body":"your body1","Name":"Michael","Age":"36"}} Hari Haran C