Reputation: 29867
When a device wants to send a message to a 3rd-party server going through CCS, if CSS cannot deliver the message to the server, will it store the message like Google Cloud Messaging does, or does it inform the device that it could not send it and the app on the device is responsible for resending it again at a later time?
Also, if CCS does connect to the 3rd-party server but there is a problem sending the message, will it inform the client app of the error?
Upvotes: 2
Views: 608
Reputation: 393781
Based on the API of the GoogleCloudMessaging class, the message gets stored in the GCM server, just like Cloud to Device messages, depending on the specified timeToLive
.
CCS will return an error in case of a problem to send the message only if the specified timeToLive
is 0.
public void send (String to, String msgId, long timeToLive, Bundle data)
Send a "device to cloud" message. The current limits for max storage time and number of outstanding messages per application are documented in the GCM Dev Guide.
Parameters
to string identifying the receiver of the message. For GCM projects IDs the value is [email protected]. The SENDER_ID should be one of the sender IDs used in register().
msgId ID of the message. This is generated by the application. It must be unique for each message. This allows error callbacks and debugging.
timeToLive If 0, we'll attempt to send immediately and return an error if we're not connected. Otherwise, the message will be queued. As for server-side messages, we don't return an error if the message has been dropped because of TTL—this can happen on the server side, and it would require extra communication.
data key/value pairs to be sent. Values must be String, any other type will be ignored.
Throws
IOException
public void send (String to, String msgId, Bundle data)
Send a "device to cloud" message. The message will be queued if we don't have an active connection for the max interval.
Parameters
to string identifying the receiver of the message. For GCM project IDs the value is [email protected]. The SENDER_ID should be one of the sender IDs used in register().
msgId ID of the message. This is generated by the application. It must be unique for each message. This allows error callbacks and debugging.
data key/value pairs to be sent. Values must be String—any other type will be ignored.
Throws
IOException
Upvotes: 1