diff --git a/docs/html/guide/google/gcm/adv.jd b/docs/html/guide/google/gcm/adv.jd index aa66e25bdd11c..356ee1d2b0032 100644 --- a/docs/html/guide/google/gcm/adv.jd +++ b/docs/html/guide/google/gcm/adv.jd @@ -163,7 +163,7 @@ registerReceiver(mRetryReceiver, filter);

There are two ways to unregister a device from GCM: manually and automatically.

An Android application can manually unregister itself by issuing a com.google.android.c2dm.intent.UNREGISTER intent, which is useful when the application offers a logoff feature (so it can unregister on logoff and register again on logon). See the Architectural Overview for more discussion of this topic. This is the sequence of events when an application unregisters itself:

    -
  1. The application issues a com.google.android.c2dm.intent.UNREGISTER intent, passing the registration ID (the application should have saved its registration ID when it received the proper com.google.android.c2dm.intent.REGISTRATION intent).
  2. +
  3. The application issues a com.google.android.c2dm.intent.UNREGISTER intent, passing the package name as an extra.
  4. When the GCM server is done with the unregistration, it sends a com.google.android.c2dm.intent.REGISTRATION intent with the unregistered extra set.
  5. The application then must contact the 3rd-party server so it can remove the registration ID.
  6. The application should also clear its registration ID. @@ -174,7 +174,7 @@ registerReceiver(mRetryReceiver, filter);
  7. The end user uninstalls the application.
  8. The 3rd-party server sends a message to GCM server.
  9. The GCM server sends the message to the device.
  10. -
  11. The GCM client receives the message and queries Package Manager about whether there are broadcast receivers configured to receive it, which returns false. +
  12. The GCM client receives the message and queries Package Manager about whether there are broadcast receivers configured to receive it, which returns false.
  13. The GCM client informs the GCM server that the application was uninstalled.
  14. The GCM server marks the registration ID for deletion.
  15. @@ -183,6 +183,9 @@ registerReceiver(mRetryReceiver, filter);
  16. The 3rd-party deletes the registration ID.
+ +

Note: The GCM client is the Google Cloud Messaging framework present on the device.

+

Note that it might take a while for the registration ID be completely removed from GCM. Thus it is possible that messages sent during step 7 above gets a valid message ID as response, even though the message will not be delivered to the device. Eventually, the registration ID will be removed and the server will get a NotRegistered error, without any further action being required from the 3rd-party server (this scenario happens frequently while an application is being developed and tested).

Send-to-Sync vs. Messages with Payload

diff --git a/docs/html/guide/google/gcm/gcm.jd b/docs/html/guide/google/gcm/gcm.jd index c4dfecf33e3cd..a47ceb9b6ddce 100644 --- a/docs/html/guide/google/gcm/gcm.jd +++ b/docs/html/guide/google/gcm/gcm.jd @@ -773,13 +773,8 @@ the HTTP response contains a non-200 status code (such as 400, 401, or 503).

There was an error authenticating the sender account. Troubleshoot - 500 - There was an internal error in the GCM server while trying to process the request. Troubleshoot - - - 503 - Indicates that the server is temporarily unavailable (i.e., because of timeouts, etc ). Sender must retry later, honoring any Retry-After header - included in the response. Application servers must implement exponential back-off. The GCM server took too long to process the request. Troubleshoot + 5xx + Errors in the 500-599 range (such as 500 or 503) indicate that there was an internal error in the GCM server while trying to process the request, or that the server is temporarily unavailable (for example, because of timeouts). Sender must retry later, honoring any Retry-After header included in the response. Application servers must implement exponential back-off. Troubleshoot @@ -935,17 +930,15 @@ all messages at the same time. Senders that cause problems risk being blacklisted.
-Happens when the HTTP status code is 503, or when the error field of a JSON object in the results array is Unavailable. +Happens when the HTTP status code is between 501 and 599, or when the error field of a JSON object in the results array is Unavailable.
Internal Server Error
The server encountered an error while trying to process the request. You -could retry the same request (obeying the requirements listed in the Timeout +could retry the same request (obeying the requirements listed in the Timeout section), but if the error persists, please report the problem in the android-gcm group. -
-Senders that cause problems risk being blacklisted.
Happens when the HTTP status code is 500, or when the error field of a JSON object in the results array is InternalServerError. diff --git a/docs/html/guide/google/gcm/gs.jd b/docs/html/guide/google/gcm/gs.jd index 93eb79448e2c1..8d132d859020c 100644 --- a/docs/html/guide/google/gcm/gs.jd +++ b/docs/html/guide/google/gcm/gs.jd @@ -145,7 +145,9 @@ page.title=GCM: Getting Started
  • If the value is dynamic, the service should override the getSenderIds() method.
  • +

    Step 3: Write the my_app_package.GCMIntentService class

    +

    Next write the my_app_package.GCMIntentService class, overriding the following callback methods (which are called by GCMBroadcastReceiver):