java.lang.Object | |
↳ | com.google.android.gcm.server.Result |
Result of a GCM message request that returned HTTP status code 200.
If the message is successfully created, the getMessageId()
returns
the message id and getErrorCodeName()
returns null;
otherwise, getMessageId()
returns null and
getErrorCodeName()
returns the code of the error.
There are cases when a request is accept and the message successfully created, but GCM has a canonical registration id for that device. In this case, the server should update the registration id to avoid rejected requests in the future.
In a nutshell, the workflow to handle a result is:
- CallgetMessageId()
: - null means error, callgetErrorCodeName()
- non-null means the message was created: - CallgetCanonicalRegistrationId()
- if it returns null, do nothing. - otherwise, update the server datastore with the new id.
Nested Classes | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Result.Builder |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the canonical registration id, if any.
| |||||||||||
Gets the error code, if any.
| |||||||||||
Gets the message id, if any.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Gets the canonical registration id, if any.
Gets the error code, if any.
Gets the message id, if any.