How can I get FCM instant delivery status like now or never. for example If i sent a push message to a specific device , if the device is offline I want to get false status instantly. I've tried XMPP protocol with delivery_receipt_requested flag but it response success whenever device back online. But I want FCM as now or never with delivery status.
Asked
Active
Viewed 2,744 times
0
-
3Possible duplicate of [FCM Notification Delivery Report](https://stackoverflow.com/questions/40109563/fcm-notification-delivery-report) – AskNilesh Mar 27 '18 at 04:57
-
https://stackoverflow.com/questions/41700719/how-to-check-the-delivery-status-of-firebase-message-sent-to-an-android-applicat – AskNilesh Mar 27 '18 at 04:57
-
https://stackoverflow.com/questions/40781933/fcm-track-status-fcm-push-notification – AskNilesh Mar 27 '18 at 04:58
-
@NileshRathod I guess it is not duplicate issue. I already tried your provided link but yet no luck. I want FCM delivery status instantly NOT when it arrives through programmatically – theshemul Mar 27 '18 at 05:06
-
The duplicate post stands. The use-case you want is not possible without the XMPP protocol. The way FCM works is that sending a message from your server directs it to the FCM server where it is enqueued to send towards the client. The fastest response you could receive is the result between the communication of your App server and the FCM server. – AL. Mar 27 '18 at 05:15
-
@AL. I tried XMPP protocol. It notifies me when the message arrived but I want if the message can not be delivered by now then it should notified me instantly. Is this possible ? – theshemul Mar 27 '18 at 05:31
1 Answers
0
FCM does not provide the capability you want. An alternative would be to use Real Time Database to implement a "presence system". A sample is provided in the docs. You could then use the presence status for a device to decide what messages to send to it.

Bob Snyder
- 37,759
- 6
- 111
- 158
-
nice ! thanks +1 but I thought it could be done easily somehow. Is there any other alternative way to determine the device is connected with server or ready to get fcm push.. I will try your solution – theshemul Mar 27 '18 at 17:25
-
You might also want to experiment with the [Instance ID Service](https://developers.google.com/instance-id/reference/server). You can get the "connectionType" of a device, but I don't know how realtime the status is. It may not be a true indication of whether the device is connected or not. – Bob Snyder Mar 27 '18 at 18:23