diff options
Diffstat (limited to 'docs/html/guide/google/gcm')
19 files changed, 333 insertions, 116 deletions
diff --git a/docs/html/guide/google/gcm/adv.jd b/docs/html/guide/google/gcm/adv.jd index 39e946e..2174128 100644 --- a/docs/html/guide/google/gcm/adv.jd +++ b/docs/html/guide/google/gcm/adv.jd @@ -175,7 +175,8 @@ registerReceiver(mRetryReceiver, filter); <li>The end user uninstalls the application.</li> <li>The 3rd-party server sends a message to GCM server.</li> <li>The GCM server sends the message to the device.</li> - <li>The GCM client receives the message and queries Package Manager, which returns a "package not found" error.</li> + <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>. +</li> <li>The GCM client informs the GCM server that the application was uninstalled.</li> <li>The GCM server marks the registration ID for deletion.</li> <li>The 3rd-party server sends a message to GCM.</li> @@ -203,7 +204,7 @@ registerReceiver(mRetryReceiver, filter); <p>GCM allows a maximum of 4 different collapse keys to be used by the GCM server at any given time. In other words, the GCM server can simultaneously store 4 different send-to-sync messages, each with a different collapse key. If you exceed this number GCM will only keep 4 collapse keys, with no guarantees about which ones they will be.</p> <h3 id="payload">Messages with payload</h3> -<p>Unlike a send-to-sync message, every "message with payload" (non-collapsible message) is delivered. The payload the message contains can be up to 4K. For example, here is a JSON-formatted message in an IM application in which spectators are discussing a sporting event:</p> +<p>Unlike a send-to-sync message, every "message with payload" (non-collapsible message) is delivered. The payload the message contains can be up to 4kb. For example, here is a JSON-formatted message in an IM application in which spectators are discussing a sporting event:</p> <pre class="prettyprint pretty-json">{ "registration_id" : "APA91bHun4MxP5egoKMwt2KZFBaFUH-1RYqx...", diff --git a/docs/html/guide/google/gcm/client-javadoc/allclasses-frame.html b/docs/html/guide/google/gcm/client-javadoc/allclasses-frame.html index 26916d5..e1bed36 100644 --- a/docs/html/guide/google/gcm/client-javadoc/allclasses-frame.html +++ b/docs/html/guide/google/gcm/client-javadoc/allclasses-frame.html @@ -2,12 +2,12 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 --> +<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 --> <TITLE> All Classes </TITLE> -<META NAME="date" CONTENT="2012-07-16"> +<META NAME="date" CONTENT="2012-08-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="default.css" TITLE="Style"> diff --git a/docs/html/guide/google/gcm/client-javadoc/allclasses-noframe.html b/docs/html/guide/google/gcm/client-javadoc/allclasses-noframe.html index 6ae9fe0..dc34021 100644 --- a/docs/html/guide/google/gcm/client-javadoc/allclasses-noframe.html +++ b/docs/html/guide/google/gcm/client-javadoc/allclasses-noframe.html @@ -2,12 +2,12 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 --> +<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 --> <TITLE> All Classes </TITLE> -<META NAME="date" CONTENT="2012-07-16"> +<META NAME="date" CONTENT="2012-08-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="default.css" TITLE="Style"> diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBaseIntentService.html b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBaseIntentService.html index eed1aea..ff15218 100644 --- a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBaseIntentService.html +++ b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBaseIntentService.html @@ -2,12 +2,12 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:36 PDT 2012 --> +<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 --> <TITLE> GCMBaseIntentService </TITLE> -<META NAME="date" CONTENT="2012-07-16"> +<META NAME="date" CONTENT="2012-08-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../default.css" TITLE="Style"> diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBroadcastReceiver.html b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBroadcastReceiver.html index 2a1c676..ae80bf7 100644 --- a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBroadcastReceiver.html +++ b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBroadcastReceiver.html @@ -2,12 +2,12 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:36 PDT 2012 --> +<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 --> <TITLE> GCMBroadcastReceiver </TITLE> -<META NAME="date" CONTENT="2012-07-16"> +<META NAME="date" CONTENT="2012-08-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../default.css" TITLE="Style"> diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMConstants.html b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMConstants.html index f778f06..205bcf0 100644 --- a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMConstants.html +++ b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMConstants.html @@ -2,12 +2,12 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:36 PDT 2012 --> +<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 --> <TITLE> GCMConstants </TITLE> -<META NAME="date" CONTENT="2012-07-16"> +<META NAME="date" CONTENT="2012-08-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../default.css" TITLE="Style"> @@ -177,8 +177,8 @@ Constants used by the GCM library. <TD><CODE><B><A HREF="../../../../com/google/android/gcm/GCMConstants.html#EXTRA_APPLICATION_PENDING_INTENT">EXTRA_APPLICATION_PENDING_INTENT</A></B></CODE> <BR> - Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION"><CODE>INTENT_TO_GCM_REGISTRATION</CODE></A> to get the application - id.</TD> + Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION">"com.google.android.c2dm.intent.REGISTER"</A> to get the + application info.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> @@ -186,16 +186,25 @@ Constants used by the GCM library. <TD><CODE><B><A HREF="../../../../com/google/android/gcm/GCMConstants.html#EXTRA_ERROR">EXTRA_ERROR</A></B></CODE> <BR> - Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate + Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate an error when the registration fails.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.String</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../../com/google/android/gcm/GCMConstants.html#EXTRA_FROM">EXTRA_FROM</A></B></CODE> + +<BR> + Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE">"com.google.android.c2dm.intent.RECEIVE"</A> to indicate which + sender (Google API project id) sent the message.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE>static java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/google/android/gcm/GCMConstants.html#EXTRA_REGISTRATION_ID">EXTRA_REGISTRATION_ID</A></B></CODE> <BR> - Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate + Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate the registration id when the registration succeeds.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> @@ -204,8 +213,8 @@ Constants used by the GCM library. <TD><CODE><B><A HREF="../../../../com/google/android/gcm/GCMConstants.html#EXTRA_SENDER">EXTRA_SENDER</A></B></CODE> <BR> - Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION"><CODE>INTENT_TO_GCM_REGISTRATION</CODE></A> to indicate the sender - account (a Google email) that owns the application.</TD> + Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION">"com.google.android.c2dm.intent.REGISTER"</A> to indicate which + senders (Google API project ids) can send messages to the application.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> @@ -213,7 +222,7 @@ Constants used by the GCM library. <TD><CODE><B><A HREF="../../../../com/google/android/gcm/GCMConstants.html#EXTRA_SPECIAL_MESSAGE">EXTRA_SPECIAL_MESSAGE</A></B></CODE> <BR> - Type of message present in the <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE"><CODE>INTENT_FROM_GCM_MESSAGE</CODE></A> intent.</TD> + Type of message present in the <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE">"com.google.android.c2dm.intent.RECEIVE"</A> intent.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> @@ -229,7 +238,7 @@ Constants used by the GCM library. <TD><CODE><B><A HREF="../../../../com/google/android/gcm/GCMConstants.html#EXTRA_UNREGISTERED">EXTRA_UNREGISTERED</A></B></CODE> <BR> - Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate + Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate that the application has been unregistered.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> @@ -388,8 +397,8 @@ EXTRA_SENDER</H3> <PRE> public static final java.lang.String <B>EXTRA_SENDER</B></PRE> <DL> -<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION"><CODE>INTENT_TO_GCM_REGISTRATION</CODE></A> to indicate the sender - account (a Google email) that owns the application. +<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION">"com.google.android.c2dm.intent.REGISTER"</A> to indicate which + senders (Google API project ids) can send messages to the application. <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.google.android.gcm.GCMConstants.EXTRA_SENDER">Constant Field Values</A></DL> @@ -401,8 +410,8 @@ EXTRA_APPLICATION_PENDING_INTENT</H3> <PRE> public static final java.lang.String <B>EXTRA_APPLICATION_PENDING_INTENT</B></PRE> <DL> -<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION"><CODE>INTENT_TO_GCM_REGISTRATION</CODE></A> to get the application - id. +<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION">"com.google.android.c2dm.intent.REGISTER"</A> to get the + application info. <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.google.android.gcm.GCMConstants.EXTRA_APPLICATION_PENDING_INTENT">Constant Field Values</A></DL> @@ -414,7 +423,7 @@ EXTRA_UNREGISTERED</H3> <PRE> public static final java.lang.String <B>EXTRA_UNREGISTERED</B></PRE> <DL> -<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate +<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate that the application has been unregistered. <P> <DL> @@ -427,7 +436,7 @@ EXTRA_ERROR</H3> <PRE> public static final java.lang.String <B>EXTRA_ERROR</B></PRE> <DL> -<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate +<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate an error when the registration fails. See constants starting with ERROR_ for possible values. <P> @@ -441,7 +450,7 @@ EXTRA_REGISTRATION_ID</H3> <PRE> public static final java.lang.String <B>EXTRA_REGISTRATION_ID</B></PRE> <DL> -<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate +<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate the registration id when the registration succeeds. <P> <DL> @@ -454,7 +463,7 @@ EXTRA_SPECIAL_MESSAGE</H3> <PRE> public static final java.lang.String <B>EXTRA_SPECIAL_MESSAGE</B></PRE> <DL> -<DD>Type of message present in the <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE"><CODE>INTENT_FROM_GCM_MESSAGE</CODE></A> intent. +<DD>Type of message present in the <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE">"com.google.android.c2dm.intent.RECEIVE"</A> intent. This extra is only set for special messages sent from GCM, not for messages originated from the application. <P> @@ -482,13 +491,26 @@ public static final java.lang.String <B>EXTRA_TOTAL_DELETED</B></PRE> <DL> <DD>Number of messages deleted by the server because the device was idle. Present only on messages of special type - <A HREF="../../../../com/google/android/gcm/GCMConstants.html#VALUE_DELETED_MESSAGES"><CODE>VALUE_DELETED_MESSAGES</CODE></A> + <A HREF="../../../../com/google/android/gcm/GCMConstants.html#VALUE_DELETED_MESSAGES">"deleted_messages"</A> <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.google.android.gcm.GCMConstants.EXTRA_TOTAL_DELETED">Constant Field Values</A></DL> </DL> <HR> +<A NAME="EXTRA_FROM"><!-- --></A><H3> +EXTRA_FROM</H3> +<PRE> +public static final java.lang.String <B>EXTRA_FROM</B></PRE> +<DL> +<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE">"com.google.android.c2dm.intent.RECEIVE"</A> to indicate which + sender (Google API project id) sent the message. +<P> +<DL> +<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.google.android.gcm.GCMConstants.EXTRA_FROM">Constant Field Values</A></DL> +</DL> +<HR> + <A NAME="PERMISSION_GCM_INTENTS"><!-- --></A><H3> PERMISSION_GCM_INTENTS</H3> <PRE> diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMRegistrar.html b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMRegistrar.html index bb486ff..c29bf90 100644 --- a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMRegistrar.html +++ b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMRegistrar.html @@ -2,12 +2,12 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:36 PDT 2012 --> +<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 --> <TITLE> GCMRegistrar </TITLE> -<META NAME="date" CONTENT="2012-07-16"> +<META NAME="date" CONTENT="2012-08-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../default.css" TITLE="Style"> @@ -308,11 +308,12 @@ public static void <B>checkManifest</B>(Context context)</PRE> <li>It defines at least one <CODE>BroadcastReceiver</CODE> with category <code>PACKAGE_NAME</code>. <li>The <CODE>BroadcastReceiver</CODE>(s) uses the - permission. - <li>The <CODE>BroadcastReceiver</CODE>(s) handles the 3 GCM intents - (, - , - and ). + <A HREF="../../../../com/google/android/gcm/GCMConstants.html#PERMISSION_GCM_INTENTS">"com.google.android.c2dm.permission.SEND"</A> + permission. + <li>The <CODE>BroadcastReceiver</CODE>(s) handles the 2 GCM intents + (<A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE">"com.google.android.c2dm.intent.RECEIVE"</A> + and + <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A>). </ol> ...where <code>PACKAGE_NAME</code> is the application package. <p> diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-frame.html b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-frame.html index 4828eea..a2a599d 100644 --- a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-frame.html +++ b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-frame.html @@ -2,12 +2,12 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 --> +<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 --> <TITLE> com.google.android.gcm </TITLE> -<META NAME="date" CONTENT="2012-07-16"> +<META NAME="date" CONTENT="2012-08-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../default.css" TITLE="Style"> diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-summary.html b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-summary.html index 877248b..c8e0341 100644 --- a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-summary.html +++ b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-summary.html @@ -2,12 +2,12 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 --> +<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 --> <TITLE> com.google.android.gcm </TITLE> -<META NAME="date" CONTENT="2012-07-16"> +<META NAME="date" CONTENT="2012-08-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../default.css" TITLE="Style"> diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-tree.html b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-tree.html index bf6fce3..0e27efe 100644 --- a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-tree.html +++ b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-tree.html @@ -2,12 +2,12 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 --> +<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 --> <TITLE> com.google.android.gcm Class Hierarchy </TITLE> -<META NAME="date" CONTENT="2012-07-16"> +<META NAME="date" CONTENT="2012-08-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../default.css" TITLE="Style"> diff --git a/docs/html/guide/google/gcm/client-javadoc/constant-values.html b/docs/html/guide/google/gcm/client-javadoc/constant-values.html index 6ccd123..796d196 100644 --- a/docs/html/guide/google/gcm/client-javadoc/constant-values.html +++ b/docs/html/guide/google/gcm/client-javadoc/constant-values.html @@ -2,12 +2,12 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 --> +<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 --> <TITLE> Constant Field Values </TITLE> -<META NAME="date" CONTENT="2012-07-16"> +<META NAME="date" CONTENT="2012-08-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="default.css" TITLE="Style"> @@ -173,6 +173,12 @@ com.google.*</FONT></TH> <TD ALIGN="right"><CODE>"error"</CODE></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> +<A NAME="com.google.android.gcm.GCMConstants.EXTRA_FROM"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> +<CODE>public static final java.lang.String</CODE></FONT></TD> +<TD ALIGN="left"><CODE><A HREF="com/google/android/gcm/GCMConstants.html#EXTRA_FROM">EXTRA_FROM</A></CODE></TD> +<TD ALIGN="right"><CODE>"from"</CODE></TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> <A NAME="com.google.android.gcm.GCMConstants.EXTRA_REGISTRATION_ID"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <CODE>public static final java.lang.String</CODE></FONT></TD> <TD ALIGN="left"><CODE><A HREF="com/google/android/gcm/GCMConstants.html#EXTRA_REGISTRATION_ID">EXTRA_REGISTRATION_ID</A></CODE></TD> diff --git a/docs/html/guide/google/gcm/client-javadoc/default.css b/docs/html/guide/google/gcm/client-javadoc/default.css index 2513e69..f11daf7 100644 --- a/docs/html/guide/google/gcm/client-javadoc/default.css +++ b/docs/html/guide/google/gcm/client-javadoc/default.css @@ -530,12 +530,12 @@ h3:target { } .design ol { counter-reset: item; } - .design ol li { + .design ol>li { font-size: 14px; line-height: 20px; list-style-type: none; position: relative; } - .design ol li:before { + .design ol>li:before { content: counter(item) ". "; counter-increment: item; position: absolute; @@ -561,16 +561,18 @@ h3:target { content: "9. "; } .design ol li.value-10:before { content: "10. "; } -.design .with-callouts ol li { +.design .with-callouts ol>li { list-style-position: inside; margin-left: 0; } - .design .with-callouts ol li:before { + .design .with-callouts ol>li:before { display: inline; left: -20px; float: left; width: 17px; color: #33b5e5; font-weight: 500; } +.design .with-callouts ul>li { + list-style-position: outside; } /* special list items */ li.no-bullet { @@ -1079,22 +1081,71 @@ color-stop(50%, #acbc00), color-stop(50%, #bdde00), color-stop(100%, #bdde00)); Print Only ========================================================================== */ @media print { -a { - color: inherit; -} -.nav-x, .nav-y { - display: none; -} -.str { color: #060; } -.kwd { color: #006; font-weight: bold; } -.com { color: #600; font-style: italic; } -.typ { color: #404; font-weight: bold; } -.lit { color: #044; } -.pun { color: #440; } -.pln { color: #000; } -.tag { color: #006; font-weight: bold; } -.atn { color: #404; } -.atv { color: #060; } + /* configure printed page */ + @page { + margin: 0.75in 1in; + widows: 4; + orphans: 4; + } + + /* reset spacing metrics */ + html, body, .wrap { + margin: 0 !important; + padding: 0 !important; + width: auto !important; + } + + /* leave enough space on the left for bullets */ + body { + padding-left: 20px !important; + } + #doc-col { + margin-left: 0; + } + + /* hide a bunch of non-content elements */ + #header, #footer, #nav-x, #side-nav, + .training-nav-top, .training-nav-bottom, + #doc-col .content-footer, + .nav-x, .nav-y, + .paging-links, + a.totop { + display: none !important; + } + + /* remove extra space above page titles */ + #doc-col .content-header { + margin-top: 0; + } + + /* bump up spacing above subheadings */ + h2 { + margin-top: 40px !important; + } + + /* print link URLs where possible and give links default text color */ + p a:after { + content: " (" attr(href) ")"; + font-size: 80%; + } + p a { + word-wrap: break-word; + } + a { + color: inherit; + } + + /* syntax highlighting rules */ + .str { color: #060; } + .kwd { color: #006; font-weight: bold; } + .com { color: #600; font-style: italic; } + .typ { color: #404; font-weight: bold; } + .lit { color: #044; } + .pun { color: #440; } + .pln { color: #000; } + .tag { color: #006; font-weight: bold; } + .atn { color: #404; } + .atv { color: #060; } } /* ============================================================================= @@ -2033,8 +2084,11 @@ div.toggle-content.closed .toggle-content-toggleme { #jd-content img.toggle-content-img { margin:0 5px 5px 0; } -div.toggle-content > p { - padding:0 0 5px; +div.toggle-content p { + margin:10px 0 0; +} +div.toggle-content-toggleme { + padding:0 0 0 15px; } @@ -2145,14 +2199,9 @@ table.blank th, table.blank td { .nolist { list-style:none; - padding:0; - margin:0 0 1em 1em; + margin-left:0; } -.nolist li { - padding:0 0 2px; - margin:0; -} pre.classic { background-color:transparent; @@ -2180,6 +2229,12 @@ p.table-caption { color:#666; } +div.note, +div.caution, +div.warning { + margin: 0 0 15px; +} + p.note, div.note, p.caution, div.caution, p.warning, div.warning { @@ -2898,10 +2953,6 @@ ul#search_filtered { /* SEARCH RESULTS */ -/* disable twiddle and size selectors for left column */ -#leftSearchControl div { - padding:0; -} #leftSearchControl .gsc-twiddle { background-image : none; @@ -3475,7 +3526,7 @@ EndColorStr='#ececec'); .morehover:hover { opacity:1; - height:345px; + height:385px; width:268px; -webkit-transition-property:height, -webkit-opacity; } @@ -3489,7 +3540,7 @@ EndColorStr='#ececec'); .morehover .mid { width:228px; background:url(../images/more_mid.png) repeat-y; - padding:10px 20px 10px 20px; + padding:10px 20px 0 20px; } .morehover .mid .header { @@ -3598,15 +3649,19 @@ a.download-sdk { padding-top: 14px; } +#nav-x .wrap { + min-height:34px; +} + #nav-x .wrap, #searchResults.wrap { max-width:940px; border-bottom:1px solid #CCC; - min-height:34px; - } - +#searchResults.wrap #leftSearchControl { + min-height:700px +} .nav-x { margin-left:0; margin-bottom:0; @@ -3762,7 +3817,8 @@ a.download-sdk { height: 300px; } .slideshow-develop img.play { - width:350px; + max-width:350px; + max-height:240px; margin:20px 0 0 90px; -webkit-transform: perspective(800px ) rotateY( 35deg ); box-shadow: -16px 20px 40px rgba(0, 0, 0, 0.3); @@ -3817,6 +3873,7 @@ a.download-sdk { .feed .feed-nav li { list-style: none; float: left; + height: 21px; /* +4px bottom border = 25px; same as .feed-nav */ margin-right: 25px; cursor: pointer; } @@ -3969,21 +4026,24 @@ a.download-sdk { .landing-docs { margin:20px 0 0; } -.landing-banner { - height:280px; -} .landing-banner .col-6:first-child, -.landing-docs .col-6:first-child { +.landing-docs .col-6:first-child, +.landing-docs .col-12 { margin-left:0; + min-height:280px; } .landing-banner .col-6:last-child, -.landing-docs .col-6:last-child { +.landing-docs .col-6:last-child, +.landing-docs .col-12 { margin-right:0; } .landing-banner h1 { margin-top:0; } +.landing-docs { + clear:left; +} .landing-docs h3 { font-size:14px; line-height:21px; @@ -4002,4 +4062,99 @@ a.download-sdk { .plusone { float:right; -}
\ No newline at end of file +} + + + +/************* HOME/LANDING PAGE *****************/ + +.slideshow-home { + height: 500px; + width: 940px; + border-bottom: 1px solid #CCC; + position: relative; + margin: 0; +} +.slideshow-home .frame { + width: 940px; + height: 500px; +} +.slideshow-home .content-left { + float: left; + text-align: center; + vertical-align: center; + margin: 0 0 0 35px; +} +.slideshow-home .content-right { + margin: 80px 0 0 0; +} +.slideshow-home .content-right p { + margin-bottom: 10px; +} +.slideshow-home .content-right p:last-child { + margin-top: 15px; +} +.slideshow-home .content-right h1 { + padding:0; +} +.slideshow-home .item { + height: 500px; + width: 940px; +} +.home-sections { + padding: 30px 20px 20px; + margin: 20px 0; + background: -webkit-linear-gradient(top, #F6F6F6,#F9F9F9); +} +.home-sections ul { + margin: 0; +} +.home-sections ul li { + float: left; + display: block; + list-style: none; + width: 170px; + height: 35px; + border: 1px solid #ccc; + background: white; + margin-right: 10px; + border-radius: 1px; + -webkit-border-radius: 1px; + -moz-border-radius: 1px; + box-shadow: 1px 1px 5px #EEE; + -webkit-box-shadow: 1px 1px 5px #EEE; + -moz-box-shadow: 1px 1px 5px #EEE; + background: white; +} +.home-sections ul li:hover { + background: #F9F9F9; + border: 1px solid #CCC; +} +.home-sections ul li a, +.home-sections ul li a:hover { + font-weight: bold; + margin-top: 8px; + line-height: 18px; + float: left; + width: 100%; + text-align: center; + color: #09c !important; +} +.home-sections ul li a { + font-weight: bold; + margin-top: 8px; + line-height: 18px; + float: left; + width:100%; + text-align:center; +} +.home-sections ul li img { + float: left; + margin: -8px 0 0 10px; +} +.home-sections ul li.last { + margin-right: 0px; +} +#footer { + margin-top: -40px; +} diff --git a/docs/html/guide/google/gcm/client-javadoc/deprecated-list.html b/docs/html/guide/google/gcm/client-javadoc/deprecated-list.html index 6b86bfe..d9a63c5 100644 --- a/docs/html/guide/google/gcm/client-javadoc/deprecated-list.html +++ b/docs/html/guide/google/gcm/client-javadoc/deprecated-list.html @@ -2,12 +2,12 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 --> +<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 --> <TITLE> Deprecated List </TITLE> -<META NAME="date" CONTENT="2012-07-16"> +<META NAME="date" CONTENT="2012-08-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="default.css" TITLE="Style"> diff --git a/docs/html/guide/google/gcm/client-javadoc/help-doc.html b/docs/html/guide/google/gcm/client-javadoc/help-doc.html index ffd1f77..af1bca8 100644 --- a/docs/html/guide/google/gcm/client-javadoc/help-doc.html +++ b/docs/html/guide/google/gcm/client-javadoc/help-doc.html @@ -2,12 +2,12 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 --> +<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 --> <TITLE> API Help </TITLE> -<META NAME="date" CONTENT="2012-07-16"> +<META NAME="date" CONTENT="2012-08-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="default.css" TITLE="Style"> diff --git a/docs/html/guide/google/gcm/client-javadoc/index-all.html b/docs/html/guide/google/gcm/client-javadoc/index-all.html index 74e6095..408edee 100644 --- a/docs/html/guide/google/gcm/client-javadoc/index-all.html +++ b/docs/html/guide/google/gcm/client-javadoc/index-all.html @@ -2,12 +2,12 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 --> +<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 --> <TITLE> Index </TITLE> -<META NAME="date" CONTENT="2012-07-16"> +<META NAME="date" CONTENT="2012-08-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="./default.css" TITLE="Style"> @@ -124,29 +124,33 @@ Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gc server that can be retried later. <DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_APPLICATION_PENDING_INTENT"><B>EXTRA_APPLICATION_PENDING_INTENT</B></A> - Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A> -<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION"><CODE>GCMConstants.INTENT_TO_GCM_REGISTRATION</CODE></A> to get the application - id. +<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION">"com.google.android.c2dm.intent.REGISTER"</A> to get the + application info. <DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_ERROR"><B>EXTRA_ERROR</B></A> - Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A> -<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>GCMConstants.INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate +<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate an error when the registration fails. +<DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_FROM"><B>EXTRA_FROM</B></A> - +Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A> +<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE">"com.google.android.c2dm.intent.RECEIVE"</A> to indicate which + sender (Google API project id) sent the message. <DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_REGISTRATION_ID"><B>EXTRA_REGISTRATION_ID</B></A> - Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A> -<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>GCMConstants.INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate +<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate the registration id when the registration succeeds. <DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_SENDER"><B>EXTRA_SENDER</B></A> - Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A> -<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION"><CODE>GCMConstants.INTENT_TO_GCM_REGISTRATION</CODE></A> to indicate the sender - account (a Google email) that owns the application. +<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION">"com.google.android.c2dm.intent.REGISTER"</A> to indicate which + senders (Google API project ids) can send messages to the application. <DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_SPECIAL_MESSAGE"><B>EXTRA_SPECIAL_MESSAGE</B></A> - Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A> -<DD>Type of message present in the <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE"><CODE>GCMConstants.INTENT_FROM_GCM_MESSAGE</CODE></A> intent. +<DD>Type of message present in the <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE">"com.google.android.c2dm.intent.RECEIVE"</A> intent. <DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_TOTAL_DELETED"><B>EXTRA_TOTAL_DELETED</B></A> - Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A> <DD>Number of messages deleted by the server because the device was idle. <DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_UNREGISTERED"><B>EXTRA_UNREGISTERED</B></A> - Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A> -<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>GCMConstants.INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate +<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate that the application has been unregistered. </DL> <HR> diff --git a/docs/html/guide/google/gcm/client-javadoc/index.html b/docs/html/guide/google/gcm/client-javadoc/index.html index 26e57f6..fa7af90 100644 --- a/docs/html/guide/google/gcm/client-javadoc/index.html +++ b/docs/html/guide/google/gcm/client-javadoc/index.html @@ -2,7 +2,7 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc on Mon Jul 16 14:13:37 PDT 2012--> +<!-- Generated by javadoc on Wed Aug 22 13:22:47 PDT 2012--> <TITLE> Generated Documentation (Untitled) </TITLE> diff --git a/docs/html/guide/google/gcm/client-javadoc/overview-tree.html b/docs/html/guide/google/gcm/client-javadoc/overview-tree.html index c9076f1..392f3e0 100644 --- a/docs/html/guide/google/gcm/client-javadoc/overview-tree.html +++ b/docs/html/guide/google/gcm/client-javadoc/overview-tree.html @@ -2,12 +2,12 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 --> +<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 --> <TITLE> Class Hierarchy </TITLE> -<META NAME="date" CONTENT="2012-07-16"> +<META NAME="date" CONTENT="2012-08-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="default.css" TITLE="Style"> diff --git a/docs/html/guide/google/gcm/gcm.jd b/docs/html/guide/google/gcm/gcm.jd index 79edb9f..5515f31 100644 --- a/docs/html/guide/google/gcm/gcm.jd +++ b/docs/html/guide/google/gcm/gcm.jd @@ -56,7 +56,7 @@ page.title=GCM Architectural Overview </div> </div> -<p>Google Cloud Messaging for Android (GCM) is a service that helps +<p>Google Cloud Messaging for Android (GCM) is a free service that helps developers send data from servers to their Android applications on Android devices. This could be a lightweight message telling the Android application that there is new data to be fetched from the server (for instance, a movie uploaded by a friend), or it could be a message containing up to 4kb of payload data (so apps like instant messaging can consume the message directly). The GCM service handles all aspects of queueing of messages and delivery to the target Android application running on the target device.</p> @@ -203,7 +203,7 @@ ID in a database. </li> <p>The registration ID lasts until the Android application explicitly unregisters itself, or until Google refreshes the registration ID for your Android application.</p> -<p class="note"><strong>Note:</strong> When users uninstall an application, it is not automatically unregistered on GCM. It is only unregistered when the GCM server tries to send a message to the device and the device answers that the application is uninstalled. At that point, you server should mark the device as unregistered (the server will receive a <code><a href="#unreg_device">NotRegistered</a></code> error). +<p class="note"><strong>Note:</strong> When users uninstall an application, it is not automatically unregistered on GCM. It is only unregistered when the GCM server tries to send a message to the device and the device answers that the application is uninstalled or it does not have a broadcast receiver configured to receive <code>com.google.android.c2dm.intent.RECEIVE</code> intents. At that point, you server should mark the device as unregistered (the server will receive a <code><a href="#unreg_device">NotRegistered</a></code> error). <p> Note that it might take a few minutes for the registration ID to be completed removed from the GCM server. So if the 3rd party server sends a message during this time, it will get a valid message ID, even though the message will not be delivered to the device.</p> </p> @@ -545,7 +545,8 @@ private void handleRegistration(Intent intent) { <p>The <code>com.google.android.c2dm.intent.RECEIVE</code> intent is used by GCM to deliver the messages sent by the 3rd-party server to the application running in the device. If the server included key-pair values in the <code>data</code> parameter, they are available as -extras in this intent, with the keys being the extra names. +extras in this intent, with the keys being the extra names. GCM also includes an extra called +<code>from</code> which contains the sender ID as an string, and another called <code>collapse_key</code> containing the collapse key (when in use). <p>Here is an example, again using the <code>MyIntentReceiver</code> class:</p> @@ -651,8 +652,9 @@ message sent by the application server. See <a href="adv.html#collapsible">Advan <tr> <td><code>data</code></td> <td>A JSON object whose fields represents the key-value pairs of the message's payload data. If present, the payload data it will be -included in the Intent as application data, with the key being the extra's name. For instance, <code>"data":{"score":"3x1"}</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code> -There is no limit on the number of key/value pairs, though there is a limit on the total size of the message. Optional.</td> +included in the Intent as application data, with the key being the extra's name. For instance, <code>"data":{"score":"3x1"}</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code>. +There is no limit on the number of key/value pairs, though there is a limit on the total size of the message (4kb). The values could be any JSON object, but we recommend using strings, since the values will be converted to strings in the GCM server anyway. If you want to include objects or other non-string data types (such as integers or booleans), you have to do the conversion to string yourself. Also note that the key cannot be a reserved word (<code>from</code> or any word starting with <code>google.</code>). To complicate things slightly, there are some reserved words (such as <code>collapse_key</code>) that are technically allowed in payload data. However, if the request also contains the word, the value in the request will overwrite the value in the payload data. Hence using words that are defined as field names in this table is not recommended, even in cases where they are technically allowed. Optional.</td> + </tr> <tr> <td><code>delay_while_idle</code></td> @@ -683,7 +685,8 @@ sent. Optional. The default value is <code>false</code>, and must be a JSON bool </tr> <tr> <td><code>data.<key></code></td> - <td>Payload data, expressed as parameters prefixed with <code>data.</code> and suffixed as the key. For instance, a parameter of <code>data.score=3x1</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code>. There is no limit on the number of key/value parameters, though there is a limit on the total size of the message. Optional.</td> + <td>Payload data, expressed as parameters prefixed with <code>data.</code> and suffixed as the key. For instance, a parameter of <code>data.score=3x1</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code>. There is no limit on the number of key/value parameters, though there is a limit on the total size of the message. Also note that the key cannot be a reserved word (<code>from</code> or any word starting with +<code>google.</code>). To complicate things slightly, there are some reserved words (such as <code>collapse_key</code>) that are technically allowed in payload data. However, if the request also contains the word, the value in the request will overwrite the value in the payload data. Hence using words that are defined as field names in this table is not recommended, even in cases where they are technically allowed. Optional.</td> </tr> <tr> <td><code>delay_while_idle</code></td> @@ -695,7 +698,7 @@ sent. Optional. The default value is <code>false</code>, and must be a JSON bool </tr> </table> - +<p>If you want to test your request (either JSON or plain text) without delivering the message to the devices, you can set an optional HTTP parameter called <code>dry_run</code> with the value <code>true</code>. The result will be almost identical to running the request without this parameter, except that the message will not be delivered to the devices. Consequently, the response will contain fake IDs for the message and multicast fields (see <a href="#response">Response format</a>).</p> <h4 id="example-requests">Example requests</h4> <p>Here is the smallest possible request (a message without any parameters and just one recipient) using JSON:</p> @@ -814,7 +817,7 @@ the HTTP response contains a non-200 status code (such as 400, 401, or 503).</p> <li>Otherwise, get the value of <code>error</code>: <ul> <li>If it is <code>Unavailable</code>, you could retry to send it in another request.</li> - <li>If it is <code>NotRegistered</code>, you should remove the registration ID from your server database because the application was uninstalled from the device.</li> + <li>If it is <code>NotRegistered</code>, you should remove the registration ID from your server database because the application was uninstalled from the device or it does not have a broadcast receiver configured to receive <code>com.google.android.c2dm.intent.RECEIVE</code> intents.</li> <li>Otherwise, there is something wrong in the registration ID passed in the request; it is probably a non-recoverable error that will also require removing the registration from the server database. See <a href="#error_codes">Interpreting an error response</a> for all possible error values.</li> </ul> </li> @@ -848,6 +851,7 @@ has the format of <code>registration_id=<em>canonical ID</em></code>. The second <dt id="invalid_reg"><strong>Invalid Registration ID</strong></dt> <dd>Check the formatting of the registration ID that you pass to the server. Make sure it matches the registration ID the phone receives in the <code>com.google.android.c2dm.intent.REGISTRATION</code> intent and that you're not truncating it or adding additional characters. <br/>Happens when error code is <code>InvalidRegistration</code>.</dd> + <dt id="mismatched_sender"><strong>Mismatched Sender</strong></dt> <dd>A registration ID is tied to a certain group of senders. When an application registers for GCM usage, it must specify which senders are allowed to send messages. Make sure you're using one of those when trying to send messages to the device. If you switch to a different sender, the existing registration IDs won't work. Happens when error code is <code>MismatchSenderId</code>.</dd> @@ -858,15 +862,21 @@ Happens when error code is <code>MismatchSenderId</code>.</dd> <li>If the application manually unregisters by issuing a <span class="prettyprint pretty-java"><code>com.google.android.c2dm.intent.UNREGISTER</code></span><code> </code>intent.</li> <li>If the application is automatically unregistered, which can happen (but is not guaranteed) if the user uninstalls the application.</li> <li>If the registration ID expires. Google might decide to refresh registration IDs. </li> + <li>If the application is updated but the new version does not have a broadcast receiver configured to receive <code>com.google.android.c2dm.intent.RECEIVE</code> intents.</li> </ul> For all these cases, you should remove this registration ID from the 3rd-party server and stop using it to send messages. <br/>Happens when error code is <code>NotRegistered</code>.</dd> - <dt id="big_msg"><strong>Message Too Big</strong></dt> +<dt id="big_msg"><strong>Message Too Big</strong></dt> <dd>The total size of the payload data that is included in a message can't exceed 4096 bytes. Note that this includes both the size of the keys as well as the values. <br/>Happens when error code is <code>MessageTooBig</code>.</dd> +<dt id="invalid_datakey"><strong>Invalid Data Key</strong></dt> +<dd>The payload data contains a key (such as <code>from</code> or any value prefixed by <code>google.</code>) that is used internally by GCM in the <code>com.google.android.c2dm.intent.RECEIVE</code> Intent and cannot be used. Note that some words (such as <code>collapse_key</code>) are also used by GCM but are allowed in the payload, in which case the payload value will be overridden by the GCM value. +<br /> +Happens when the error code is <code>InvalidDataKey</code>.</dd> + <dt id="ttl_error"><strong>Invalid Time To Live</strong></dt> <dd>The value for the Time to Live field must be an integer representing a duration in seconds between 0 and 2,419,200 (4 weeks). Happens when error code is <code>InvalidTtl</code>. </dd> @@ -879,8 +889,22 @@ messages. <li>Request originated from a server not whitelisted in the Server Key IPs.</li> </ul> -Check that the token you're sending inside the <code>Authorization</code> header is the correct API key associated with your project.<br/> +Check that the token you're sending inside the <code>Authorization</code> header is the correct API key associated with your project. You can check the validity of your API key by running the following command:<br/> + + +<pre># api_key=YOUR_API_KEY +# curl --header "Authorization: key=$api_key" --header Content-Type:"application/json" https://android.googleapis.com/gcm/send -d "{\"registration_ids\":[\"ABC\"]}"</pre> + + + +If you receive a 401 HTTP status code, your API key is not valid. Otherwise you should see something like this:<br/> + +<pre> +{"multicast_id":6782339717028231855,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"InvalidRegistration"}]} +</pre> +If you want to confirm the validity of a registration ID, you can do so by replacing "ABC" with the registration ID. +<br/> Happens when the HTTP status code is 401. <dt id="timeout"><strong>Timeout</strong></dt> @@ -974,7 +998,7 @@ registration_id=32 <p>To view statistics and any error messages for your GCM applications:</p> <ol> - <li> Go to <code><a href="http://play.google.com/apps/publish">play.google.com/apps/publish</a></code>.</li> + <li> Go to the <code><a href="http://play.google.com/apps/publish">Android Developer Console</a></code>.</li> <li>Login with your developer account. <p>You will see a page that has a list of all of your apps.</p></li> <li> Click on the "statistics" link next to the app for which you want to view GCM stats. @@ -982,6 +1006,8 @@ registration_id=32 <li>Go to the drop-down menu and select the GCM metric you want to view. </li> </ol> +<p class="note"><strong>Note:</strong> Stats on the Google API Console are not enabled for GCM. You must use the <a href="http://play.google.com/apps/publish">Android Developer Console</a>.</p> + <h2 id="example">Examples</h2> <p>See the <a href="demo.html">GCM Demo Application</a> document.</p> diff --git a/docs/html/guide/google/gcm/index.jd b/docs/html/guide/google/gcm/index.jd index 140b076..8079eba 100644 --- a/docs/html/guide/google/gcm/index.jd +++ b/docs/html/guide/google/gcm/index.jd @@ -5,6 +5,8 @@ page.title=Google Cloud Messaging for Android <p><img src="{@docRoot}images/gcm/gcm-logo.png" /></p> <p>Google Cloud Messaging for Android (GCM) is a service that helps developers send data from servers to their Android applications on Android devices. This could be a lightweight message telling the Android application that there is new data to be fetched from the server (for instance, a movie uploaded by a friend), or it could be a message containing up to 4kb of payload data (so apps like instant messaging can consume the message directly). The GCM service handles all aspects of queueing of messages and delivery to the target Android application running on the target device.</p> +<p>GCM is completely free no matter how big your messaging needs are, and there are no quotas.</p> + <p>To learn more about GCM, you can join the <a href="https://groups.google.com/forum/?fromgroups#!forum/android-gcm">android-gcm group</a> and read the following documents:</p> <dl> |
