FCM Message delivery report is not received - android

I use an Application Server to send downstream message to android device via FCM using XMPP.
As mentioned in docmentation, I set "delivery_receipt_requested" to true, but most of the times I am not receiving delivery request report from device. I just receive ACK messages from FCM which confirms that Data Message is delivered to FCM Server (but not received by the target android device).
Is there any way from experts to help me?

Related

Fetching analytics related to push notification in `FCM Cloud Messaging`

I want to know whether push notifications are delivered to all the registrationId mapped to my user database or not.
I have 8000 users and all are having registrationId. I had sent notification to all of them and now i want to determine whether all those user had received the notification or not.
so is there any way to access this analytics using some FCM url.
I am aware that i can see analytics in google publisher from STATISTICS menu and selecting FCM messages and to check the delivery status i can go to FCM Diagnostics
Firebase support page
but using that tool to determine 8k users is nearly impossible so how can i get the analytics of cloud messaging.
Long back i have seen some link but forgot to bookmark :(
There is currently no API to retrieve the delivery status for sent FCM messages.
In general, when the FCM server successfully receives the payload you've sent from your App Server, it should return a success:1 response along with a message_id.
If what you're aiming for is to know if the device has successfully received the message, you should implement Delivery Receipts:
Delivery Receipt: If the app server included delivery_receipt_requested in the downstream message, the XMPP connection server sends a delivery receipt when it receives confirmation that the device received the message.

GCM Sent messages before subscribing

I just implemented Google Cloud Messaging successfully in my Android application and to test it I sent some messages from my server, that worked perfectly.
I was wondering what happens if I send a message to an specific topic and then a device subscribes to that topic, will it receive the message?
Will my users receive the messages I sent while I was testing it?
Thanks
I have not found this behavior defined in the GCM documentation. My experience (version 8.3.0) has been that when a client subscribes to a topic, it does not receive messages previously sent to that topic. Although messages have a default time_to_live of 4 weeks, server processing to hold the message and send it later is only applied to devices that have subscribed but are not able to receive the message because they are turned off or do not have a network connection.

Can I use node or node-gcm to recieve upstream messages from an android device?

All of the examples I see are pushing notifications from the server to the client. How do I contact the server from the client and how would the path look?
Normal http requests can be matched using app.get('path',callback). Is this same matcher used to match gcm requests?
The GCM Cloud Connection Server (XMPP) is meant to send messages back and forth from Server to Client and from Client to server. It provides a persistent, asynchronous, bidirectional connection to Google servers. The connection can be used to send and receive messages between your server and your users' GCM-connected devices.
JSON messages are send across the network for both Upstream and Downstream messaging. Every message sent to CCS receives either an Acknowledgement or a No Acknowledgement response. Messages that haven't received one of these responses are considered pending. If the pending message count reaches 100, the 3rd-party app server should stop sending new messages and wait for CCS to acknowledge some of the existing pending messages.
For more details visit this official Google document.
To look for an app implementation where you can send messages both upstream and downstream you can take a look at this tutorial
Hope that Helps!!
Found something that might be useful. The example node.js implement xmpp server that in turn receives upstream message from device to server. Hope this helps out.
link

GCM Server knowing of successful delivery

As far I as know, upon successful posting a notification to GCM Server, it will return a status code of 200 and a response as such id=1:2342.
However, according to their documentation, this does not guarantee successful delivery to the device. Just a successful status of delivering the notification to the GCM server.
So my question is, is there a way for me to know that the notification has been sent to the phone successfully? Is there a Delivery Notification returned by GCM to my side upon successful delivery? If not, does any of you guys have any ideas on keeping track of those?
Thanks.
GCM does not notify your server when the message is sent to the phone.
If you require that functionality, you'll have to implement it yourself. You can attach a message identifier field to the GCM message. When the message arrives to the phone, your app will send that message identifier back to your server (using an HTTP request), to acknowledge that it received the message.

GCM Message Delivery Confirmation

I am implementing push notifications with Google Cloud Messaging. I am simply testing with their demo applicaitons on official site.
All is working well.
But, has anyone idea of how to gurantee the delivery of message, in anyway?
Or can we invoke server to let know once the message are delivered in device, and will it be reliable approach?
Take a look at the answer on Android GCM delivery monitoring.
"They don't guarantee delivery but they try for a max of 4 weeks to deliver the message depending on the duration you set in the message you send to Google's GCM servers and if you wish to let Google keep the data for eventual delivery of msg to the device in case the device was offline when the message was to be delivered."
Google has added support so that you can receive delivery receipts from Cloud Connection Server (CCS):
You can use upstream messaging to get delivery receipts (sent from CCS to your 3rd party app server) when a device confirms that it received a message sent by CCS.
To enable this feature, the message your 3rd-party app server sends to CCS must include a field called "delivery_receipt_requested". When this field is set to true, CCS sends a delivery receipt when a device confirms that it received a particular message.
https://developers.google.com/cloud-messaging/ccs#receipts

Categories

Resources