79613302

Date: 2025-05-08 23:38:02
Score: 0.5
Natty:
Report link

According to my Review from The answers, practice code and Documentation I discovered that the onMessageReceived() method is called effectively depending on the type of message whether notification message or data message. All you have commented but the solution that make me to comment is that:

The stack started when tried to send a message the message was received in the foreground app but not in the background. This is not true in the onMessageReceived() method when the message is either Data or Data plus notification.

In the on message was trying to send the data to the server but the server don't get the data when on background or killed while after Logging the onMessageReceived() run effectively. The problem was the way was handling the logic of data sending.

I tried to start a service to do this until finally after making the service foreground the data was received to server whether the app is killed, or foreground. You need to perform short job in the method or will not be run, schedule a job and run with worker or use foreground service otherwise.

Reasons:
  • Blacklisted phrase (1): to comment
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Daudi Mabula