You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>There are two ways to unregister a device from GCM: manually and automatically.</p>
164
164
<p>An Android application can manually unregister itself by issuing a <code>com.google.android.c2dm.intent.UNREGISTER</code> intent, which is useful when the application offers a logoff feature (so it can unregister on logoff and register again on logon). See the <a href="gcm.html#unregistering">Architectural Overview</a> for more discussion of this topic. This is the sequence of events when an application unregisters itself:</p>
165
165
<ol>
166
-
<li> The application issues a <code>com.google.android.c2dm.intent.UNREGISTER</code> intent, passing the registration ID (the application should have saved its registration ID when it received the proper <code>com.google.android.c2dm.intent.REGISTRATION</code> intent).</li>
166
+
<li> The application issues a <code>com.google.android.c2dm.intent.UNREGISTER</code> intent, passing the package name as an extra.</li>
167
167
<li>When the GCM server is done with the unregistration, it sends a <code>com.google.android.c2dm.intent.REGISTRATION</code> intent with the <code>unregistered</code> extra set.</li>
168
168
<li>The application then must contact the 3rd-party server so it can remove the registration ID.</li>
169
169
<li>The application should also clear its registration ID.
<li>The 3rd-party server sends a message to GCM server.</li>
176
176
<li>The GCM server sends the message to the device.</li>
177
-
<li>The GCM client receives the message and queries Package Manager about whether there are broadcast receivers configured to receive it, which returns <code>false</code>.
177
+
<li>The GCM client receives the message and queries Package Manager about whether there are broadcast receivers configured to receive it, which returns <code>false</code>.
178
178
</li>
179
179
<li>The GCM client informs the GCM server that the application was uninstalled.</li>
180
180
<li>The GCM server marks the registration ID for deletion.</li>
<p class ="note"><strong>Note:</strong> The GCM client is the Google Cloud Messaging framework present on the device.</p>
188
+
186
189
<p>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 <code>NotRegistered</code> error, without any further action being required from the 3rd-party server (this scenario happens frequently while an application is being developed and tested).</p>
187
190
188
191
<h2 id="collapsible">Send-to-Sync vs. Messages with Payload</h2>
Copy file name to clipboardExpand all lines: docs/html/guide/google/gcm/gcm.jd
+4-11Lines changed: 4 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -769,13 +769,8 @@ the HTTP response contains a non-200 status code (such as 400, 401, or 503).</p>
769
769
<td>There was an error authenticating the sender account. <a href="#auth_error">Troubleshoot</a></td>
770
770
</tr>
771
771
<tr>
772
-
<td>500</td>
773
-
<td>There was an internal error in the GCM server while trying to process the request. <a href="#internal_error">Troubleshoot</a></td>
774
-
</tr>
775
-
<tr>
776
-
<td>503</td>
777
-
<td>Indicates that the server is temporarily unavailable (i.e., because of timeouts, etc ). Sender must retry later, honoring any <code>Retry-After</code> header
778
-
included in the response. Application servers must implement exponential back-off. The GCM server took too long to process the request. <a href="#internal_error">Troubleshoot</a></td>
772
+
<td>5xx</td>
773
+
<td>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 <code>Retry-After</code> header included in the response. Application servers must implement exponential back-off. <a href="#internal_error">Troubleshoot</a></td>
779
774
</tr>
780
775
</table>
781
776
@@ -933,17 +928,15 @@ all messages at the same time.</li>
933
928
934
929
Senders that cause problems risk being blacklisted.
935
930
<br />
936
-
Happens when the HTTP status code is 503, or when the <code>error</code> field of a JSON object in the results array is <code>Unavailable</code>.
931
+
Happens when the HTTP status code is between 501 and 599, or when the <code>error</code> field of a JSON object in the results array is <code>Unavailable</code>.
937
932
</dd>
938
933
939
934
<dt id="internal_error"><strong>Internal Server Error</strong></dt>
940
935
941
936
<dd>
942
937
The server encountered an error while trying to process the request. You
943
-
could retry the same request (obeying the requirements listed in the <strong>Timeout</strong>
938
+
could retry the same request (obeying the requirements listed in the <a href="#timeout">Timeout</a>
944
939
section), but if the error persists, please report the problem in the <a href="https://groups.google.com/forum/?fromgroups#!forum/android-gcm">android-gcm group</a>.
945
-
<br />
946
-
Senders that cause problems risk being blacklisted.
947
940
<br />
948
941
Happens when the HTTP status code is 500, or when the <code>error</code> field of a JSON
949
942
object in the results array is <code>InternalServerError</code>.
Copy file name to clipboardExpand all lines: docs/html/guide/google/gcm/gs.jd
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -145,7 +145,9 @@ page.title=GCM: Getting Started
145
145
<li>If the value is dynamic, the service should override the <code>getSenderIds()</code> method.</li>
146
146
</ul>
147
147
148
+
148
149
<h4>Step 3: Write the my_app_package.GCMIntentService class</h4>
150
+
149
151
<p>Next write the <code>my_app_package.GCMIntentService</code> class, overriding the following callback methods (which are called by <code>GCMBroadcastReceiver</code>):<br>
0 commit comments