How to check the delivery status of Firebase message sent to an Android application? [duplicate]

限于喜欢 提交于 2019-11-28 06:50:17

Update:

The Diagnostics Tool has been removed since Nov. 30, 2017:

You can no longer access FCM diagnostics data in the Play Console.


Confirming what @user7410521 said in the comments section. There is currently no available API to make use of the message_ids/multicast_ids to retrieve the details of the delivery status of the message sent, other than using the FCM Diagnostics Page. Do also keep in mind that the Diagnostics page is only usable when the app is already published (for Alpha testing or later).

I noticed that you included the delivery_receipt_requested parameter in your payload. Receiving the a message confirmation should be enough to determine that the device received the message.

Though there is no API so far also I could find out. I have tried a workarond. From the server side PHP I am sending an FCM message. Let me present how I have handled this in PHP.

$fcm_return = fcm_message_send($message);
$fcm_return_JSON = json_decode($fcm_return, true);
echo $$fcm_return_JSON['success'];

As I am sending a message to one device, I am comparing return with 1. Based on this you could further implement your logic.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!