summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorkmccormick <kmccormick@google.com>2014-11-13 22:34:03 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-13 22:34:03 +0000
commit127809334c2c576b398c1bacc34bd179aea26f7c (patch)
tree0dc72a523852069978b6c3d72b01c1ac51c6d9e5 /docs
parent628d2606f757da7b6734c7cd438535069f77b065 (diff)
parent90bdbe8c999df88330b28daa492eeb4425863dab (diff)
downloadframeworks_base-127809334c2c576b398c1bacc34bd179aea26f7c.zip
frameworks_base-127809334c2c576b398c1bacc34bd179aea26f7c.tar.gz
frameworks_base-127809334c2c576b398c1bacc34bd179aea26f7c.tar.bz2
am 90bdbe8c: am 30aee7fc: am feb1347b: Merge "Doc update: new reg error code + snippet" into lmp-docs
* commit '90bdbe8c999df88330b28daa492eeb4425863dab': Doc update: new reg error code + snippet
Diffstat (limited to 'docs')
-rw-r--r--docs/html/google/gcm/ccs.jd18
-rw-r--r--docs/html/google/gcm/client.jd15
2 files changed, 31 insertions, 2 deletions
diff --git a/docs/html/google/gcm/ccs.jd b/docs/html/google/gcm/ccs.jd
index 7db7a74..6332b8d 100644
--- a/docs/html/google/gcm/ccs.jd
+++ b/docs/html/google/gcm/ccs.jd
@@ -263,6 +263,21 @@ message is &quot;nack&quot;. A NACK message contains:</p>
&lt;/message&gt;
</pre>
+<p>Device Message Rate Exceeded:</p>
+
+<pre>&lt;message id=&quot;...&quot;&gt;
+ &lt;gcm xmlns=&quot;google:mobile:data&quot;&gt;
+ {
+ &quot;message_type&quot;:&quot;nack&quot;,
+ &quot;message_id&quot;:&quot;msgId1&quot;,
+ &quot;from&quot;:&quot;REGID&quot;,
+ &quot;error&quot;:&quot;DEVICE_MESSAGE_RATE_EXCEEDED&quot;,
+ &quot;error_description&quot;:&quot;Downstream message rate exceeded for this registration id&quot;
+ }
+ &lt;/gcm&gt;
+&lt;/message&gt;
+</pre>
+
<p>The following table lists NACK error codes. Unless otherwise
indicated, a NACKed message should not be retried. Unexpected NACK error codes
should be treated the same as {@code INTERNAL_SERVER_ERROR}.</p>
@@ -303,8 +318,7 @@ message should be immediately retried over another connection.</td>
<td>{@code DEVICE_MESSAGE_RATE_EXCEEDED}</td>
<td>The rate of messages to a particular device is too high. You should reduce
the number of messages sent to this device and should not immediately retry
-sending to this device. This error code replaces {@code QUOTA_EXCEEDED},
-which has been deprecated.</td>
+sending to this device. This error code is replacing {@code QUOTA_EXCEEDED}.</td>
</tr>
<tr>
<td>{@code SERVICE_UNAVAILABLE}</td>
diff --git a/docs/html/google/gcm/client.jd b/docs/html/google/gcm/client.jd
index 70109c6..d44ee3c 100644
--- a/docs/html/google/gcm/client.jd
+++ b/docs/html/google/gcm/client.jd
@@ -452,6 +452,21 @@ private void storeRegistrationId(Context context, String regId) {
editor.commit();
}</pre>
+<h4 id="reg-errors">Handle registration errors</h4>
+
+<p>As stated above, an Android app must register with GCM servers and get a registration ID
+(regID) before it can receive messages. A given regID is not guaranteed to last indefinitely,
+so the first thing your app should always do is check to make sure it has a valid regID
+(as shown in the code snippets above).</p>
+
+<p>In addition to confirming that it has a valid regID, your app should be prepared to handle
+the registration error {@code TOO_MANY_REGISTRATIONS}. This error indicates that the device
+has too many apps registered with GCM. The error only occurs in cases where there are
+extreme numbers of apps, so it should not affect the average user. The remedy is to prompt
+the user to delete some of the other GCM-enabled apps from the device to make
+room for the new one.</p>
+
+
<h3 id="sample-send">Send a message</h3>
<p>When the user clicks the app's <strong>Send</strong> button, the app sends an
upstream message using the