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
Related
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.
I want to know whether AWS SNS (Simple Notification Service) delivery receipts indicate:
whether AWS SNS delivered the push notification just to the relevant push notification service (e. g. GCM, APNS), or
whether the push notification was actually delivered to the mobile phone of the targeted user
The documentation appears vague on this.
I'd also like to know if, in case the second case above is true, whether the delivery receipts are also delivered when the app has been force-killed by the user.
SNS supports GCM over HTTP only, so you will only know when SNS has delivered the message to GCM not to the device. In order to get a delivery receipt that the message has been received by the device you would have to use XMPP.
See the docs for more.
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.
Simple question: is it possible to tell an Android phone to take a photo and send it (provided I have an appropriate client app installed), and all of that using only GCM? Or is there a size limit on the messages pushed from the phone?
The GCM documentation doesn't say explicitelly what's the size limit for an upstream message (device to cloud), so it's safe to assume the same size limit applies for both upstream and downstream messages - i.e. 4k bytes.
Unlike a send-to-sync message, every "message with payload" (non-collapsible message) is delivered. The payload the message contains can be up to 4kb.
Therefore you can't use GCM to send a photo from your phone to your server. You could send a downstream message from your server to the app via GCM, and the broadcast receiver that handles that message can start an intent service that would take the photo, contact your server and upload to it the photo (not using GCM).
As Eran said, its quite true. Please follow Google GCM Services:
http://developer.android.com/google/gcm/index.html
And other related documentation can be found at:
http://developer.android.com/google/gcm/gcm.html
I am developing mobile client for emailing service. One of the key features is notifications about new messages in the mailbox. As recommended by GCM architecture guidelines we are using a "Pusher" that is responsible for sending messages to the Google servers once we received a new message. The issue is that testing process has reported about serious problems with push notification delivery to devices.
So the question: is there an approaches for monitoring average statistics about push notification delivery percentage, time etc? Or maybe somebody have experience in how to set up test environment for efficient monitoring of how much notifications are getting lost during the application work?
All the "tips&tricks" related to the improving Android GCM experience are welcome.
Google claims that the processing at their GCM server takes less than a millisecond. Link below for a great video on GCM from Google's developer. And it's believable coz I could get push notifications almost instantaneously using my company's server to my device now.
http://www.youtube.com/watch?v=YoaP6hcDctM
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 message to the device in case the device was offline when the message was to be delivered.
However, there are certain conditions under which the GCM messages are not delivered.
Background data is unchecked under Account and Sync settings.
Prior to 4.0.4.(ICS), a Google account on the device is a pre-requisite for GCM. Maybe, Users are not logged into their Google account.
The only way to do so is to report back to your server with the timestamp of the received push.
You can either
Report back to the server once you receive the notification in your GCM service. To implement, you will have to add a push id for your push notifications and send the id along with the push data. The client will have to get the timestamp once it receive the message and send it back along with the notification id. A simple php script can be done (when you send a push notification, you set the time of the send-notification and once it receives the device's timestamp it sets the receive-notification. This boils down to two fields in your database (marked in bold). In this approach you will probably not so much care about errors since it is very probable that the device will have a connection when it receives the notification and as such its request to your server will go through.
Keep a list of notifications received in your app and their timestamps. And when the sync is done, send the this data in your sync operation. This is ultimately the same approach but your server's data won't be as realtime as the first approach. However, the extra request is not required from the client's side but saving the received notifications and their timestamps is.
All in all, you will have to keep track of the notifications sent using a notification-id and their sending time (send-notification) and their receive time (receive-notification). A simple query will help you analyze this data.
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://developer.android.com/google/gcm/ccs.html#receipts
Google does not make these statistics available to you. There are some statistics available on the android developer console. This only shows the number of messages and registrations.
You would have to implement your own data collection, which could be done fairly easily. You could record the time & id of each message sent and have your android client report back to your server with the time of message receipt. You could then store the data on your server and query as needed.
Since that time Google has provided developers with advanced monitoring tool.
The Gcm Diagnostic Tool is available in Google Play developer console. Additional information is here https://support.google.com/googleplay/android-developer/answer/2663268
So you can easily track the particular message status via registration token.