Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
GCM PHP Push Message
branch: master

Merge pull request #3 from diegodepablos/patch-1

Update GCMPushMessage.php
latest commit 2023ea7e37
Matthew Grundy authored
Failed to load latest commit information.
GCMPushMessage.php Update GCMPushMessage.php Updated readme

Google Cloud Push Messaging PHP Server Class

A PHP class to send messages to devices registered through Google Cloud Messaging.


Based on the code available at:

Example usage

$devices = array('YOUR REGISTERED DEVICE ID');
$message = "The message to send";

$gcpm = new GCMPushMessage($apiKey);
$response = $gcpm->send($message, array('title' => 'Test title'));

How to obtain a Google Server API Key

  • Go to the Google Console
  • Create a new project / open project
  • Click on 'APIs & Auth' on the left
  • Find the 'Google Cloud Messaging for Android' option, and press off to turn it on
  • Go to the creditials tab on the left
  • Go the 'Public API access' section and click 'Create new key'
  • Choose 'Server key' and click 'Create'
  • The API key is now shown under the section 'Key for server applications'
Something went wrong with that request. Please try again.