<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://178.140.10.58:8080/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://178.140.10.58:8080/feed.php">
        <title>Библиотека знаний - developing:android</title>
        <description>Заметки IT программиста</description>
        <link>http://178.140.10.58:8080/</link>
        <image rdf:resource="http://178.140.10.58:8080/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-04-17T10:50:02+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://178.140.10.58:8080/doku.php?id=developing:android:gcm"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://178.140.10.58:8080/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>Библиотека знаний</title>
        <link>http://178.140.10.58:8080/</link>
        <url>http://178.140.10.58:8080/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="http://178.140.10.58:8080/doku.php?id=developing:android:gcm">
        <dc:format>text/html</dc:format>
        <dc:date>2015-10-29T11:32:24+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Нотификация GCM &amp; APNS (Google Cloud Messaging GCM)</title>
        <link>http://178.140.10.58:8080/doku.php?id=developing:android:gcm</link>
        <description>&lt;div class=&quot;tags&quot;&gt;&lt;span&gt;
	&lt;a href=&quot;http://178.140.10.58:8080/doku.php?id=tag:apns&amp;amp;do=showtag&amp;amp;tag=apns&quot; class=&quot;wikilink1 tag label label-default mx-1&quot; title=&quot;tag:apns&quot; rel=&quot;tag&quot;&gt;&lt;span class=&quot;iconify&quot;  data-icon=&quot;mdi:tag-text-outline&quot;&gt;&lt;/span&gt; apns&lt;/a&gt;,
	&lt;a href=&quot;http://178.140.10.58:8080/doku.php?id=tag:gsm&amp;amp;do=showtag&amp;amp;tag=gsm&quot; class=&quot;wikilink1 tag label label-default mx-1&quot; title=&quot;tag:gsm&quot; rel=&quot;tag&quot;&gt;&lt;span class=&quot;iconify&quot;  data-icon=&quot;mdi:tag-text-outline&quot;&gt;&lt;/span&gt; gsm&lt;/a&gt;
&lt;/span&gt;&lt;/div&gt;

&lt;h1 class=&quot;sectionedit1&quot; id=&quot;нотификация_gcm_apns_google_cloud_messaging_gcm&quot;&gt;Нотификация GCM &amp;amp; APNS (Google Cloud Messaging GCM)&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u041d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f GCM &amp;amp; APNS (Google Cloud Messaging GCM)&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f_gcm_apns_google_cloud_messaging_gcm&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;19-96&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;java&quot;&gt;Java&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;pre class=&quot;code java&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;com.javapapers.java.gcm&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;java.io.BufferedReader&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;java.io.FileReader&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;java.io.IOException&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;java.io.PrintWriter&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;javax.servlet.ServletException&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;javax.servlet.annotation.WebServlet&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;javax.servlet.http.HttpServlet&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;javax.servlet.http.HttpServletRequest&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;javax.servlet.http.HttpServletResponse&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;com.google.android.gcm.server.Message&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;com.google.android.gcm.server.Result&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;com.google.android.gcm.server.Sender&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
@WebServlet&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;/GCMNotification&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;class&lt;/span&gt; GCMNotification &lt;span class=&quot;kw1&quot;&gt;extends&lt;/span&gt; HttpServlet &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;kw1&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt; serialVersionUID &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; 1L&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Put your Google API Server Key here&lt;/span&gt;
	&lt;span class=&quot;kw1&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;final&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+string&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;String&lt;/span&gt;&lt;/a&gt; GOOGLE_SERVER_KEY &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;AIzaSyDA5dlLInMWVsJEUTIHV0u7maB82MCsZbU&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kw1&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;final&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+string&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;String&lt;/span&gt;&lt;/a&gt; MESSAGE_KEY &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;message&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;	
&amp;nbsp;
	&lt;span class=&quot;kw1&quot;&gt;public&lt;/span&gt; GCMNotification&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span class=&quot;kw1&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;kw1&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; doGet&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;HttpServletRequest request,
			HttpServletResponse response&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;throws&lt;/span&gt; ServletException, &lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+ioexception&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;IOException&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
		doPost&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;request, response&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;kw1&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; doPost&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;HttpServletRequest request,
			HttpServletResponse response&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;throws&lt;/span&gt; ServletException, &lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+ioexception&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;IOException&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
		Result result &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+string&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;String&lt;/span&gt;&lt;/a&gt; share &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; request.&lt;span class=&quot;me1&quot;&gt;getParameter&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;shareRegId&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// GCM RedgId of Android device to send push notification&lt;/span&gt;
		&lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+string&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;String&lt;/span&gt;&lt;/a&gt; regId &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;share &lt;span class=&quot;sy0&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;null&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;share.&lt;span class=&quot;me1&quot;&gt;isEmpty&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
			regId &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; request.&lt;span class=&quot;me1&quot;&gt;getParameter&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;regId&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
			&lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+printwriter&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;PrintWriter&lt;/span&gt;&lt;/a&gt; writer &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;new&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+printwriter&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;PrintWriter&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;GCMRegId.txt&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
			writer.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;regId&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
			writer.&lt;span class=&quot;me1&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
			request.&lt;span class=&quot;me1&quot;&gt;setAttribute&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;pushStatus&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;GCM RegId Received.&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
			request.&lt;span class=&quot;me1&quot;&gt;getRequestDispatcher&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;index.jsp&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
					.&lt;span class=&quot;me1&quot;&gt;forward&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;request, response&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
&amp;nbsp;
			&lt;span class=&quot;kw1&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
				&lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+bufferedreader&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;BufferedReader&lt;/span&gt;&lt;/a&gt; br &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;new&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+bufferedreader&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;BufferedReader&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;new&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+filereader&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;FileReader&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;
						&lt;span class=&quot;st0&quot;&gt;&amp;quot;GCMRegId.txt&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
				regId &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; br.&lt;span class=&quot;me1&quot;&gt;readLine&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
				br.&lt;span class=&quot;me1&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
				&lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+string&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;String&lt;/span&gt;&lt;/a&gt; userMessage &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; request.&lt;span class=&quot;me1&quot;&gt;getParameter&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;message&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
				Sender sender &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;new&lt;/span&gt; Sender&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;GOOGLE_SERVER_KEY&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
				Message message &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;new&lt;/span&gt; Message.&lt;span class=&quot;me1&quot;&gt;Builder&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;timeToLive&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
						.&lt;span class=&quot;me1&quot;&gt;delayWhileIdle&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;addData&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;MESSAGE_KEY, userMessage&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
				&lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+system&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;regId: &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; regId&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
				result &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; sender.&lt;span class=&quot;me1&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;message, regId, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
				request.&lt;span class=&quot;me1&quot;&gt;setAttribute&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;pushStatus&amp;quot;&lt;/span&gt;, result.&lt;span class=&quot;me1&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+ioexception&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;IOException&lt;/span&gt;&lt;/a&gt; ioe&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
				ioe.&lt;span class=&quot;me1&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
				request.&lt;span class=&quot;me1&quot;&gt;setAttribute&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;pushStatus&amp;quot;&lt;/span&gt;,
						&lt;span class=&quot;st0&quot;&gt;&amp;quot;RegId required: &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; ioe.&lt;span class=&quot;me1&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+exception&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Exception&lt;/span&gt;&lt;/a&gt; e&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
				e.&lt;span class=&quot;me1&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
				request.&lt;span class=&quot;me1&quot;&gt;setAttribute&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;pushStatus&amp;quot;&lt;/span&gt;, e.&lt;span class=&quot;me1&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
			request.&lt;span class=&quot;me1&quot;&gt;getRequestDispatcher&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;index.jsp&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
					.&lt;span class=&quot;me1&quot;&gt;forward&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;request, response&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;
 &lt;a href=&quot;http://javapapers.com/android/google-cloud-messaging-gcm-for-android-and-push-notifications/&quot; class=&quot;urlextern&quot; title=&quot;http://javapapers.com/android/google-cloud-messaging-gcm-for-android-and-push-notifications/&quot; rel=&quot;ugc nofollow&quot;&gt;http://javapapers.com/android/google-cloud-messaging-gcm-for-android-and-push-notifications/&lt;/a&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Java&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;java&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;97-2734&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit3&quot; id=&quot;php&quot;&gt;PHP&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;PHP&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;php&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;2735-2751&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit4&quot; id=&quot;gcm&quot;&gt;GCM&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code php&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; push_gcm&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$registrationIds&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;re0&quot;&gt;$apiAccessKey&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;AI.............b0&#039;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;re0&quot;&gt;$action&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;send_coordinate&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;re0&quot;&gt;$msg&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;array&lt;/span&gt;&lt;/a&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;
                &lt;span class=&quot;st_h&quot;&gt;&#039;message&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;st_h&quot;&gt;&#039;action&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$action&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;re0&quot;&gt;$fields&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;array&lt;/span&gt;&lt;/a&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;
                &lt;span class=&quot;st_h&quot;&gt;&#039;registration_ids&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$registrationIds&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;st_h&quot;&gt;&#039;data&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$msg&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;re0&quot;&gt;$headers&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;array&lt;/span&gt;&lt;/a&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;
                &lt;span class=&quot;st_h&quot;&gt;&#039;Authorization: key=&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$apiAccessKey&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;st_h&quot;&gt;&#039;Content-Type: application/json&#039;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;re0&quot;&gt;$ch&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/curl_init&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;curl_init&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;a href=&quot;http://www.php.net/curl_setopt&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;curl_setopt&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; CURLOPT_URL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;https://android.googleapis.com/gcm/send&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;a href=&quot;http://www.php.net/curl_setopt&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;curl_setopt&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; CURLOPT_POST&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;a href=&quot;http://www.php.net/curl_setopt&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;curl_setopt&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; CURLOPT_HTTPHEADER&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$headers&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;a href=&quot;http://www.php.net/curl_setopt&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;curl_setopt&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; CURLOPT_RETURNTRANSFER&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;a href=&quot;http://www.php.net/curl_setopt&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;curl_setopt&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; CURLOPT_SSL_VERIFYPEER&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;a href=&quot;http://www.php.net/curl_setopt&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;curl_setopt&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; CURLOPT_POSTFIELDS&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;a href=&quot;http://www.php.net/json_encode&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;json_encode&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$fields&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; JSON_UNESCAPED_UNICODE&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;a href=&quot;http://www.php.net/curl_exec&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;curl_exec&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;a href=&quot;http://www.php.net/curl_close&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;curl_close&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;GCM&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;gcm&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;2752-3771&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit5&quot; id=&quot;apns&quot;&gt;APNS&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code php&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; push_apns&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$device_tokens&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;re0&quot;&gt;$is_dev&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;re0&quot;&gt;$action&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;send_coordinate&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;re0&quot;&gt;$aps&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;
                &lt;span class=&quot;st_h&quot;&gt;&#039;content-available&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;st_h&quot;&gt;&#039;sound&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;&#039;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;re0&quot;&gt;$body&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;
                &lt;span class=&quot;st_h&quot;&gt;&#039;aps&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$aps&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;st_h&quot;&gt;&#039;action&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$action&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;re0&quot;&gt;$payload&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/json_encode&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;json_encode&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$body&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;re0&quot;&gt;$apns_port&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2195&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;re0&quot;&gt;$pathdir&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;/home/push-private/&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$is_dev&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                &lt;span class=&quot;re0&quot;&gt;$apns_url&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;gateway.sandbox.push.apple.com&#039;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;re0&quot;&gt;$apns_cert&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$pathdir&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;evak_driver_dev.pem&#039;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;re0&quot;&gt;$passphrase&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;geel_evak_driver&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                &lt;span class=&quot;re0&quot;&gt;$apns_url&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;gateway.push.apple.com&#039;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;re0&quot;&gt;$apns_cert&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$pathdir&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;evak_driver_prod.pem&#039;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;re0&quot;&gt;$passphrase&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;geel_evak_driver&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;re0&quot;&gt;$stream_context&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/stream_context_create&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;stream_context_create&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;a href=&quot;http://www.php.net/stream_context_set_option&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;stream_context_set_option&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$stream_context&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;ssl&#039;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;local_cert&#039;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$apns_cert&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;a href=&quot;http://www.php.net/stream_context_set_option&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;stream_context_set_option&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$stream_context&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;ssl&#039;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;passphrase&#039;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$passphrase&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;re0&quot;&gt;$apns&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/stream_socket_client&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;stream_socket_client&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;&#039;ssl://&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$apns_url&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;:&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$apns_port&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$error&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$error_string&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; STREAM_CLIENT_CONNECT&lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt;STREAM_CLIENT_PERSISTENT&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$stream_context&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$apns&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;foreach&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$device_tokens&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$token&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                        &lt;span class=&quot;re0&quot;&gt;$apns_message&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/chr&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;chr&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;a href=&quot;http://www.php.net/pack&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;pack&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;&#039;n&#039;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;a href=&quot;http://www.php.net/pack&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;pack&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;&#039;H*&#039;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$token&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;a href=&quot;http://www.php.net/pack&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;pack&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;&#039;n&#039;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;a href=&quot;http://www.php.net/strlen&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;strlen&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$payload&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$payload&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
                        &lt;a href=&quot;http://www.php.net/fwrite&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;fwrite&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$apns&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$apns_message&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;a href=&quot;http://www.php.net/strlen&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;strlen&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$apns_message&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                &lt;span class=&quot;sy0&quot;&gt;@&lt;/span&gt;&lt;a href=&quot;http://www.php.net/socket_close&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;socket_close&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$apns&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;sy0&quot;&gt;@&lt;/span&gt;&lt;a href=&quot;http://www.php.net/fclose&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;fclose&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$apns&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;APNS&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;apns&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;3772-5412&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit6&quot; id=&quot;статьи&quot;&gt;Статьи&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;
 &lt;a href=&quot;http://javapapers.com/android/google-cloud-messaging-gcm-for-android-and-push-notifications/&quot; class=&quot;urlextern&quot; title=&quot;http://javapapers.com/android/google-cloud-messaging-gcm-for-android-and-push-notifications/&quot; rel=&quot;ugc nofollow&quot;&gt;http://javapapers.com/android/google-cloud-messaging-gcm-for-android-and-push-notifications/&lt;/a&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0421\u0442\u0430\u0442\u044c\u0438&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0441\u0442\u0430\u0442\u044c\u0438&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;5413-&amp;quot;} --&gt;</description>
    </item>
</rdf:RDF>
