• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html>
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76<html>
77<head>
78
79
80
81<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
82
83<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
84<title>com.google.android.gcm.server | Android Developers</title>
85
86<!-- STYLESHEETS -->
87<link rel="stylesheet"
88href="//fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic,bold" title="roboto">
89<link href="/assets/css/default.css" rel="stylesheet" type="text/css">
90
91
92
93<!-- JAVASCRIPT -->
94<script src="//www.google.com/jsapi" type="text/javascript"></script>
95<script src="/assets/js/android_3p-bundle.js" type="text/javascript"></script>
96<script type="text/javascript">
97  var toRoot = "/";
98  var devsite = false;
99</script>
100<script src="/assets/js/docs.js" type="text/javascript"></script>
101
102<script type="text/javascript">
103  var _gaq = _gaq || [];
104  _gaq.push(['_setAccount', 'UA-5831155-1']);
105  _gaq.push(['_trackPageview']);
106
107  (function() {
108    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
109    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
110    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
111  })();
112</script>
113</head>
114
115<body class="gc-documentation google
116  develop">
117  <div id="doc-api-level" class="" style="display:none"></div>
118  <a name="top"></a>
119
120<a name="top"></a>
121
122    <!-- Header -->
123    <div id="header">
124        <div class="wrap" id="header-wrap">
125          <div class="col-3 logo">
126          <a href="/index.html">
127            <img src="/assets/images/dac_logo.png" width="123" height="25" alt="Android Developers" />
128          </a>
129          <div class="btn-quicknav" id="btn-quicknav">
130          	<a href="#" class="arrow-inactive">Quicknav</a>
131			      <a href="#" class="arrow-active">Quicknav</a>
132          </div>
133          </div>
134            <ul class="nav-x col-9">
135                <li class="design">
136                  <a href="/design/index.html"
137                  zh-tw-lang="設計"
138                  zh-cn-lang="设计"
139                  ru-lang="Проектирование"
140                  ko-lang="디자인"
141                  ja-lang="設計"
142                  es-lang="Diseñar"
143                  >Design</a></li>
144                <li class="develop"><a href="/develop/index.html"
145                  zh-tw-lang="開發"
146                  zh-cn-lang="开发"
147                  ru-lang="Разработка"
148                  ko-lang="개발"
149                  ja-lang="開発"
150                  es-lang="Desarrollar"
151                  >Develop</a></li>
152                <li class="distribute last"><a href="/distribute/index.html"
153                  zh-tw-lang="發佈"
154                  zh-cn-lang="分发"
155                  ru-lang="Распространение"
156                  ko-lang="배포"
157                  ja-lang="配布"
158                  es-lang="Distribuir"
159                  >Distribute</a></li>
160            </ul>
161
162            <!-- New Search -->
163            <div class="menu-container">
164            <div class="moremenu">
165    <div id="more-btn"></div>
166  </div>
167  <div class="morehover" id="moremenu">
168    <div class="top"></div>
169    <div class="mid">
170      <div class="header">Links</div>
171      <ul>
172        <li><a href="https://play.google.com/apps/publish/">Google Play Developer Console</a></li>
173        <li><a href="http://android-developers.blogspot.com/">Android Developers Blog</a></li>
174        <li><a href="/about/index.html">About Android</a></li>
175      </ul>
176      <div class="header">Android Sites</div>
177      <ul>
178        <li><a href="http://www.android.com">Android.com</a></li>
179        <li class="active"><a>Android Developers</a></li>
180        <li><a href="http://source.android.com">Android Open Source Project</a></li>
181      </ul>
182
183
184
185        <div class="header">Language</div>
186          <div id="language" class="locales">
187            <select name="language" onChange="changeLangPref(this.value, true)">
188                <option value="en">English</option>
189                <option value="es">Español</option>
190                <option value="ja">日本語</option>
191                <option value="ko">한국어</option>
192                <option value="ru">Русский</option>
193                <option value="zh-cn">中文 (中国)</option>
194                <option value="zh-tw">中文 (台灣)</option>
195            </select>
196          </div>
197        <script type="text/javascript">
198          <!--
199          loadLangPref();
200            //-->
201        </script>
202
203
204
205
206      <br class="clearfix" />
207    </div>
208    <div class="bottom"></div>
209  </div>
210  <div class="search" id="search-container">
211    <div class="search-inner">
212      <div id="search-btn"></div>
213      <div class="left"></div>
214      <form onsubmit="return submit_search()">
215        <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
216onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
217onkeydown="return search_changed(event, true, '/')"
218onkeyup="return search_changed(event, false, '/')" />
219      </form>
220      <div class="right"></div>
221        <a class="close hide">close</a>
222        <div class="left"></div>
223        <div class="right"></div>
224    </div>
225  </div>
226
227  <div class="search_filtered_wrapper reference">
228    <div class="suggest-card reference no-display">
229      <ul class="search_filtered">
230      </ul>
231    </div>
232  </div>
233
234  <div class="search_filtered_wrapper docs">
235    <div class="suggest-card dummy no-display">&nbsp;</div>
236    <div class="suggest-card develop no-display">
237      <ul class="search_filtered">
238      </ul>
239      <div class="child-card guides no-display">
240      </div>
241      <div class="child-card training no-display">
242      </div>
243    </div>
244    <div class="suggest-card design no-display">
245      <ul class="search_filtered">
246      </ul>
247    </div>
248    <div class="suggest-card distribute no-display">
249      <ul class="search_filtered">
250      </ul>
251    </div>
252  </div>
253
254  </div>
255  <!-- /New Search>
256
257
258          <!-- Expanded quicknav -->
259           <div id="quicknav" class="col-9">
260                <ul>
261                    <li class="design">
262                      <ul>
263                        <li><a href="/design/index.html">Get Started</a></li>
264                        <li><a href="/design/style/index.html">Style</a></li>
265                        <li><a href="/design/patterns/index.html">Patterns</a></li>
266                        <li><a href="/design/building-blocks/index.html">Building Blocks</a></li>
267                        <li><a href="/design/downloads/index.html">Downloads</a></li>
268                        <li><a href="/design/videos/index.html">Videos</a></li>
269                      </ul>
270                    </li>
271                    <li class="develop">
272                      <ul>
273                        <li><a href="/training/index.html"
274                          zh-tw-lang="訓練課程"
275                          zh-cn-lang="培训"
276                          ru-lang="Курсы"
277                          ko-lang="교육"
278                          ja-lang="トレーニング"
279                          es-lang="Capacitación"
280                          >Training</a></li>
281                        <li><a href="/guide/components/index.html"
282                          zh-tw-lang="API 指南"
283                          zh-cn-lang="API 指南"
284                          ru-lang="Руководства по API"
285                          ko-lang="API 가이드"
286                          ja-lang="API ガイド"
287                          es-lang="Guías de la API"
288                          >API Guides</a></li>
289                        <li><a href="/reference/packages.html"
290                          zh-tw-lang="參考資源"
291                          zh-cn-lang="参考"
292                          ru-lang="Справочник"
293                          ko-lang="참조문서"
294                          ja-lang="リファレンス"
295                          es-lang="Referencia"
296                          >Reference</a></li>
297                        <li><a href="/tools/index.html"
298                          zh-tw-lang="相關工具"
299                          zh-cn-lang="工具"
300                          ru-lang="Инструменты"
301                          ko-lang="도구"
302                          ja-lang="ツール"
303                          es-lang="Herramientas"
304                          >Tools</a>
305                          <ul><li><a href="/sdk/index.html">Get the SDK</a></li></ul>
306                        </li>
307                        <li><a href="/google/index.html">Google Services</a>
308                        </li>
309                      </ul>
310                    </li>
311                    <li class="distribute last">
312                      <ul>
313                        <li><a href="/distribute/index.html">Google Play</a></li>
314                        <li><a href="/distribute/googleplay/publish/index.html">Publishing</a></li>
315                        <li><a href="/distribute/googleplay/promote/index.html">Promoting</a></li>
316                        <li><a href="/distribute/googleplay/quality/index.html">App Quality</a></li>
317                        <li><a href="/distribute/googleplay/spotlight/index.html">Spotlight</a></li>
318                        <li><a href="/distribute/open.html">Open Distribution</a></li>
319                      </ul>
320                    </li>
321                </ul>
322          </div>
323          <!-- /Expanded quicknav -->
324        </div>
325    </div>
326    <!-- /Header -->
327
328
329  <div id="searchResults" class="wrap" style="display:none;">
330          <h2 id="searchTitle">Results</h2>
331          <div id="leftSearchControl" class="search-control">Loading...</div>
332  </div>
333
334
335
336    <!-- Secondary x-nav -->
337    <div id="nav-x">
338        <div class="wrap">
339            <ul class="nav-x col-9 develop" style="width:100%">
340                <li class="training"><a href="/training/index.html"
341                  zh-tw-lang="訓練課程"
342                  zh-cn-lang="培训"
343                  ru-lang="Курсы"
344                  ko-lang="교육"
345                  ja-lang="トレーニング"
346                  es-lang="Capacitación"
347                  >Training</a></li>
348                <li class="guide"><a href="/guide/components/index.html"
349                  zh-tw-lang="API 指南"
350                  zh-cn-lang="API 指南"
351                  ru-lang="Руководства по API"
352                  ko-lang="API 가이드"
353                  ja-lang="API ガイド"
354                  es-lang="Guías de la API"
355                  >API Guides</a></li>
356                <li class="reference"><a href="/reference/packages.html"
357                  zh-tw-lang="參考資源"
358                  zh-cn-lang="参考"
359                  ru-lang="Справочник"
360                  ko-lang="참조문서"
361                  ja-lang="リファレンス"
362                  es-lang="Referencia"
363                  >Reference</a></li>
364                <li class="tools"><a href="/tools/index.html"
365                  zh-tw-lang="相關工具"
366                  zh-cn-lang="工具"
367                  ru-lang="Инструменты"
368                  ko-lang="도구"
369                  ja-lang="ツール"
370                  es-lang="Herramientas"
371                  >Tools</a></li>
372                <li class="google"><a href="/google/index.html"
373                  >Google Services</a>
374                </li>
375            </ul>
376        </div>
377
378    </div>
379    <!-- /Sendondary x-nav -->
380
381
382
383
384
385
386
387
388
389  <div class="wrap clearfix" id="body-content">
390    <div class="col-4" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
391      <div id="devdoc-nav" class="scroll-pane">
392<a class="totop" href="#top" data-g-event="left-nav-top">to top</a>
393
394
395
396<ul id="nav">
397
398  <li class="nav-section">
399    <div class="nav-section-header empty"><a href="/google/index.html">
400          <span class="en">Overview</span>
401      </a></div>
402  </li>
403
404  <li class="nav-section">
405    <div class="nav-section-header empty"><a href="/google/play-services/games.html">
406          <span class="en">Games</span>
407      </a></div>
408  </li>
409  <li class="nav-section">
410    <div class="nav-section-header empty"><a href="/google/play-services/location.html">
411          <span class="en">Location</span>
412      </a></div>
413  </li>
414  <li class="nav-section">
415    <div class="nav-section-header empty"><a href="/google/play-services/plus.html">
416          <span class="en">Google+</span>
417                </a></div>
418  </li>
419  <li class="nav-section">
420    <div class="nav-section-header empty"><a href="/google/play-services/maps.html">
421          <span class="en">Google Maps</span>
422      </a></div>
423  </li>
424  <li class="nav-section">
425    <div class="nav-section-header empty"><a href="/google/play-services/auth.html">
426          <span class="en">Authorization</span>
427      </a></div>
428  </li>
429
430
431
432  <li class="nav-section">
433    <div class="nav-section-header"><a href="/google/play-services/index.html">
434      <span class="en">Google Play Services</span></a>
435    </div>
436    <ul>
437      <li><a href="/google/play-services/setup.html">
438          <span class="en">Setup</span></a>
439      </li>
440      <li id="gms-tree-list" class="nav-section">
441        <div class="nav-section-header">
442          <a href="/reference/gms-packages.html">
443            <span class="en">Reference</span>
444          </a>
445        <div>
446      </li>
447    </ul>
448  </li>
449
450
451  <li class="nav-section">
452    <div class="nav-section-header"><a href="/google/play/billing/index.html">
453      <span class="en">Google Play In-app Billing</span></a>
454    </div>
455    <ul>
456      <li><a href="/google/play/billing/billing_overview.html">
457              <span class="en">Overview</span></a>
458      </li>
459      <li class="nav-section"><div class="nav-section-header"><a href="/google/play/billing/api.html">
460              <span class="en">Version 3 API</span></a></div>
461              <ul>
462              <li><a href="/google/play/billing/billing_integrate.html">
463              <span class="en">Implementing the API</span></a></li>
464              <li><a href="/google/play/billing/billing_reference.html">
465              <span class="en">Reference</span></a></li>
466              </ul>
467      </li>
468      <li class="nav-section"><div class="nav-section-header"><a href="/google/play/billing/v2/api.html">
469              <span class="en">Version 2 API</span></a></div>
470              <ul>
471              <li><a href="/google/play/billing/v2/billing_integrate.html">
472              <span class="en">Implementing the API</span></a></li>
473              <li><a href="/google/play/billing/v2/billing_subscriptions.html">
474              <span class="en">Subscriptions</span></a></li>
475              <li><a href="/google/play/billing/v2/billing_reference.html">
476              <span class="en">Reference</span></a></li>
477              </ul>
478      </li>
479      <li><a href="/google/play/billing/billing_subscriptions.html">
480              <span class="en">Subscriptions</span></a>
481      </li>
482      <li><a href="/google/play/billing/billing_best_practices.html">
483              <span class="en">Security and Design</span></a>
484      </li>
485      <li><a href="/google/play/billing/billing_testing.html">
486              <span class="en">Testing In-app Billing</span></a>
487      </li>
488      <li><a href="/google/play/billing/billing_admin.html">
489              <span class="en">Administering In-app Billing</span></a>
490      </li>
491      <li><a href="/google/play/billing/gp-purchase-status-api.html">
492              <span class="en">Purchase Status API</span></a>
493      </li>
494      <li><a href="/google/play/billing/versions.html">
495              <span class="en">Version Notes</span></a>
496      </li>
497    </ul>
498  </li>
499
500
501
502  <li class="nav-section">
503      <div class="nav-section-header"><a href="/google/gcm/index.html">
504        <span class="en">Google Cloud Messaging</span></a>
505      </div>
506      <ul>
507        <li><a href="/google/gcm/gs.html">
508            <span class="en">Getting Started</span></a>
509        </li>
510        <li><a href="/google/gcm/gcm.html">
511            <span class="en">Architectural Overview</span></a>
512        </li>
513         <li><a href="/google/gcm/ccs.html">
514              <span class="en">Cloud Connection Server</span></a>
515        </li>
516        <li><a href="/google/gcm/notifications.html">
517              <span class="en">User Notifications</span></a>
518        </li>
519        <li><a href="/google/gcm/client.html">
520            <span class="en">GCM Client</span></a>
521        </li>
522        <li><a href="/google/gcm/server.html">
523            <span class="en">GCM Server</span></a>
524        </li>
525        <li><a href="/google/gcm/adv.html">
526            <span class="en">Advanced Topics</span></a>
527        </li>
528        <li><a href="/google/gcm/c2dm.html">
529            <span class="en">Migration</span></a>
530        </li>
531        <li id="gcm-tree-list" class="nav-section">
532          <div class="nav-section-header">
533            <a href="/reference/gcm-packages.html">
534              <span class="en">Reference</span>
535            </a>
536          <div>
537        </li>
538      </ul>
539  </li>
540
541  <li class="nav-section">
542    <div class="nav-section-header"><a href="/google/play/dist.html">
543      <span class="en">Google Play Distribution</span></a>
544    </div>
545    <ul>
546      <li><a href="/google/play/filters.html">
547          <span class="en">Filters on Google Play</span></a>
548      </li>
549
550      <li><a href="/google/play/publishing/multiple-apks.html">
551          <span class="en">Multiple APK Support</span></a>
552      </li>
553      <li><a href="/google/play/expansion-files.html">
554          <span class="en">APK Expansion Files</span></a>
555      </li>
556      <li class="nav-section">
557        <div class="nav-section-header"><a href="/google/play/licensing/index.html">
558          <span class="en">Application Licensing</span></a>
559        </div>
560        <ul>
561          <li><a href="/google/play/licensing/overview.html">
562              <span class="en">Licensing Overview</span></a>
563          </li>
564          <li><a href="/google/play/licensing/setting-up.html">
565              <span class="en">Setting Up for Licensing</span></a>
566          </li>
567          <li><a href="/google/play/licensing/adding-licensing.html">
568              <span class="en">Adding Licensing to Your App</span></a>
569          </li>
570          <li><a href="/google/play/licensing/licensing-reference.html">
571              <span class="en">Licensing Reference</span></a>
572          </li>
573        </ul>
574      </li>
575
576  <li class="nav-section">
577    <div class="nav-section-header"><a href="/google/backup/index.html">
578      Android Backup Service</a>
579    </div>
580    <ul>
581      <li><a href="/google/backup/signup.html">
582          Register</a>
583      </li>
584    </ul>
585  </li>
586
587  </ul>
588
589</li>
590
591
592
593</ul>
594
595<script type="text/javascript">
596<!--
597    buildToggleLists();
598    changeNavLang(getLangPref());
599//-->
600</script>
601
602
603
604
605      </div>
606      <script type="text/javascript">
607       showGoogleRefTree();
608
609      </script>
610    </div> <!-- end side-nav -->
611    <script>
612      $(document).ready(function() {
613        scrollIntoView("devdoc-nav");
614        });
615    </script>
616
617
618
619
620
621
622<div class="col-12" id="doc-col">
623
624<div id="api-info-block">
625<div class="api-level">
626
627
628
629
630</div>
631</div>
632
633<div id="jd-header">
634  package
635  <h1>com.google.android.gcm.server</h1>
636</div><!-- end header -->
637
638<div id="naMessage"></div>
639
640<div id="jd-content" class="api apilevel-">
641
642
643  <div class="jd-descr">
644    <p>Helper library for GCM HTTP server operations &mdash; see <a href="/google/gcm/server.html">GCM Server</a> for more information.</p>
645
646
647  </div>
648
649
650
651
652
653
654
655
656
657    <h2>Classes</h2>
658    <div class="jd-sumtable">
659
660  <table class="jd-sumtable-expando">
661        <tr class="alt-color api apilevel-" >
662              <td class="jd-linkcol"><a href="/reference/com/google/android/gcm/server/Constants.html">Constants</a></td>
663              <td class="jd-descrcol" width="100%">Constants used on GCM service communication.&nbsp;</td>
664          </tr>
665        <tr class=" api apilevel-" >
666              <td class="jd-linkcol"><a href="/reference/com/google/android/gcm/server/Message.html">Message</a></td>
667              <td class="jd-descrcol" width="100%">GCM message.&nbsp;</td>
668          </tr>
669        <tr class="alt-color api apilevel-" >
670              <td class="jd-linkcol"><a href="/reference/com/google/android/gcm/server/Message.Builder.html">Message.Builder</a></td>
671              <td class="jd-descrcol" width="100%">&nbsp;</td>
672          </tr>
673        <tr class=" api apilevel-" >
674              <td class="jd-linkcol"><a href="/reference/com/google/android/gcm/server/MulticastResult.html">MulticastResult</a></td>
675              <td class="jd-descrcol" width="100%">Result of a GCM multicast message request .&nbsp;</td>
676          </tr>
677        <tr class="alt-color api apilevel-" >
678              <td class="jd-linkcol"><a href="/reference/com/google/android/gcm/server/MulticastResult.Builder.html">MulticastResult.Builder</a></td>
679              <td class="jd-descrcol" width="100%">&nbsp;</td>
680          </tr>
681        <tr class=" api apilevel-" >
682              <td class="jd-linkcol"><a href="/reference/com/google/android/gcm/server/Result.html">Result</a></td>
683              <td class="jd-descrcol" width="100%">Result of a GCM message request that returned HTTP status code 200.&nbsp;</td>
684          </tr>
685        <tr class="alt-color api apilevel-" >
686              <td class="jd-linkcol"><a href="/reference/com/google/android/gcm/server/Result.Builder.html">Result.Builder</a></td>
687              <td class="jd-descrcol" width="100%">&nbsp;</td>
688          </tr>
689        <tr class=" api apilevel-" >
690              <td class="jd-linkcol"><a href="/reference/com/google/android/gcm/server/Sender.html">Sender</a></td>
691              <td class="jd-descrcol" width="100%">Helper class to send messages to the GCM service using an API Key.&nbsp;</td>
692          </tr>
693  </table>
694    </div>
695
696
697
698
699
700
701
702    <h2>Exceptions</h2>
703    <div class="jd-sumtable">
704
705  <table class="jd-sumtable-expando">
706        <tr class="alt-color api apilevel-" >
707              <td class="jd-linkcol"><a href="/reference/com/google/android/gcm/server/InvalidRequestException.html">InvalidRequestException</a></td>
708              <td class="jd-descrcol" width="100%">Exception thrown when GCM returned an error due to an invalid request.&nbsp;</td>
709          </tr>
710  </table>
711    </div>
712
713
714
715
716
717
718<div id="footer" class="wrap" >
719
720
721  <div id="copyright">
722
723  Except as noted, this content is licensed under <a
724  href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>.
725  For details and restrictions, see the <a href="/license.html">
726  Content License</a>.
727  </div>
728  <div id="build_info">
729
730<script src="/timestamp.js" type="text/javascript"></script>
731<script>document.write(BUILD_TIMESTAMP)</script>
732
733  </div>
734
735
736  <div id="footerlinks">
737
738  <p>
739    <a href="/about/index.html">About Android</a>&nbsp;&nbsp;|&nbsp;
740    <a href="/legal.html">Legal</a>&nbsp;&nbsp;|&nbsp;
741    <a href="/support.html">Support</a>
742  </p>
743  </div>
744
745</div> <!-- end footer -->
746</div><!-- end jd-content -->
747</div><!-- doc-content -->
748
749</div> <!-- end body-content -->
750
751
752
753
754
755
756</body>
757</html>
758