Can my server receive confirmation from GCM as soon as the message is sent to the Android application?

I started integrating GCM into my Android app. Using the startup tutorial I installed a sample demo and it works great. I also understood the different response states received when my server sends a message to GCM, which I think means the status of the connection between my server and the GCM server.

My question is: is there a way to get the communication status between the GCM server and the android application? This is basically a confirmation, meaning that the message was sent successfully or not. I also read that the default timeout is 4 weeks if the time_to_live flag is not set, which allows me to understand that GCM supports the queue and will definitely ensure message delivery.

However, to ensure reliability as a third-party server, will I ever need to redo the sending of the same message (if it is not already captured by the GCM infrastructure)? if I need to take care of a retry, how to identify a failure?

One way: to determine the push identifier and send it along with the message, as soon as it is received, the android application will inform the server with the corresponding push identifier. If no response is received within the specified time, the server will resend the message. This approach is defined in the second post answer and will help control the time spent by GCM (specifically for the QA team).

+8
android google-cloud-messaging
source share
2 answers

I do not believe that you can get this information from GCM servers. This means that you will have to rely on a different method of communication (as described) between client applications that successfully receive your message and your server.

The answer you get from the GCM servers (as you know) just lets you know either :

success: Number of messages that were processed without an error. 

or

 failure: Number of messages that could not be processed. 

The value is that you can know which registration identifiers were processed properly (for example, valid values ​​still registered in GCM), but whether messages were successfully delivered to the actual device.

+2
source share

According to the Google GCM documentation ... this may be useful:

http://developer.android.com/google/gcm/ccs.html#receipts

+2
source share

All Articles