Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's easy to do. The <a href="http://en.wikipedia.org/wiki/CURL" rel="noreferrer">cURL</a> code that's on the page that Elad Nava has put here works. Elad has <a href="http://developer.android.com/guide/google/gcm/gcm.html#response" rel="noreferrer">commented about the error</a> he's receiving.</p> <p>String describing an error that occurred while processing the message for that recipient. The possible values are the same as documented in the above table, plus "Unavailable" (meaning GCM servers were busy and could not process the message for that particular recipient, so it could be retried).</p> <p>I've got a service set up already that seems to be working (ish), and so far all I've had back are unavailable returns from Google. More than likely this will change soon.</p> <p>To answer the question, use PHP, make sure the <a href="http://en.wikipedia.org/wiki/Zend_Framework" rel="noreferrer">Zend Framework</a> is in your include path, and use this code:</p> <pre><code>&lt;?php ini_set('display_errors',1); include"Zend/Loader/Autoloader.php"; Zend_Loader_Autoloader::getInstance(); $url = 'https://android.googleapis.com/gcm/send'; $serverApiKey = "YOUR API KEY AS GENERATED IN API CONSOLE"; $reg = "DEVICE REGISTRATION ID"; $data = array( 'registration_ids' =&gt; array($reg), 'data' =&gt; array('yourname' =&gt; 'Joe Bloggs') ); print(json_encode($data)); $client = new Zend_Http_Client($url); $client-&gt;setMethod('POST'); $client-&gt;setHeaders(array("Content-Type" =&gt; "application/json", "Authorization" =&gt; "key=" . $serverApiKey)); $client-&gt;setRawData(json_encode($data)); $request = $client-&gt;request('POST'); $body = $request-&gt;getBody(); $headers = $request-&gt;getHeaders(); print("&lt;xmp&gt;"); var_dump($body); var_dump($headers); </code></pre> <p>And there we have it. A working (it will work soon) example of using Googles new GCM in Zend Framework PHP.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload