diff --git a/docs/example-config/conf.c2dm.inc.php.sample b/docs/example-config/conf.c2dm.inc.php.sample
deleted file mode 100644
index 7b8b40ffb92326c7eb618b164886df89300c0e0f..0000000000000000000000000000000000000000
--- a/docs/example-config/conf.c2dm.inc.php.sample
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-
-/**
- * This file contains Android Push Notification Service configuration
- * values.
- *
- * PHP Version 5.3
- *
- * @category   Config
- * @package    Core
- * @subpackage Config
- * @author     Jose viso <jose@m2mobi.com>
- * @copyright  2011-2013, M2Mobi BV, Amsterdam, The Netherlands
- * @license    http://lunr.nl/LICENSE MIT License
- */
-
-/**
- * Android Push Notification Service Settings
- * @global array $config['c2dm']
- */
-$config['c2dm'] = array();
-
-/**
- * URL for request authorization token
- * @global String $config['c2dm']['request_token_url']
- */
-$config['c2dm']['request_token_url'] = 'https://www.google.com/accounts/ClientLogin';
-
-/**
- * Account type.
- * Possible options are:
- * <ul>
- * <li>GOOGLE</li>
- * <li>HOSTED</li>
- * <li>HOSTED_OR_GOOGLE</li>
- * </ul>
- * @global String $config['c2dm']['account_type']
- */
-$config['c2dm']['account_type'] = 'HOSTED_OR_GOOGLE';
-
-/**
- * Google servers URL for sending the push notification to the device
- * @global String $config['c2dm']['google_send_url']
- */
-$config['c2dm']['google_send_url'] = 'https://android.apis.google.com/c2dm/send';
-
-/**
- * Collapse key (Arbitrary string used to collapse a group of like messages when
- *  the device is offline, so that only the last message gets sent to the client)
- * @global String $config['c2dm']['collapse_key']
- */
-$config['c2dm']['collapse_key'] = '';
-
-/**
- * Username
- * @global String $config['c2dm']['username']
- */
-$config['c2dm']['username'] = '';
-
-/**
- * Password
- * @global String $config['c2dm']['password']
- */
-$config['c2dm']['password'] = '';
-
-/**
- * Path to log-file for logging PUSH errors
- * @global String $config['c2dm']['log']
- */
-$config['c2dm']['log'] = '/var/log/httpd';
-
-?>
\ No newline at end of file
diff --git a/docs/example-config/conf.gcm.inc.php.sample b/docs/example-config/conf.gcm.inc.php.sample
new file mode 100644
index 0000000000000000000000000000000000000000..0bbd896dd00405ec4c3529567ebf8367588bf71b
--- /dev/null
+++ b/docs/example-config/conf.gcm.inc.php.sample
@@ -0,0 +1,72 @@
+<?php
+
+/**
+ * This file contains Android Push Notification Service configuration
+ * values.
+ *
+ * PHP Version 5.3
+ *
+ * @category   Config
+ * @package    Core
+ * @subpackage Config
+ * @author     Jose viso <jose@m2mobi.com>
+ * @copyright  2011-2012, M2Mobi BV, Amsterdam, The Netherlands
+ * @license    http://lunr.nl/LICENSE MIT License
+ */
+
+/**
+ * Android Push Notification Service Settings
+ * @global array $config['gcm']
+ */
+$config['gcm'] = array();
+
+/**
+ * API key for GCM which replaces the Google Authentication Token of C2DM
+ * @global String $config['gcm']['api_key']
+ */
+$config['gcm']['api_key'] = '';
+
+/**
+ * Account type.
+ * Possible options are:
+ * <ul>
+ * <li>GOOGLE</li>
+ * <li>HOSTED</li>
+ * <li>HOSTED_OR_GOOGLE</li>
+ * </ul>
+ * @global String $config['gcm']['account_type']
+ */
+$config['gcm']['account_type'] = 'HOSTED_OR_GOOGLE';
+
+/**
+ * Google servers URL for sending the push notification to the device
+ * @global String $config['gcm']['google_send_url']
+ */
+$config['gcm']['google_send_url'] = 'https://android.googleapis.com/gcm/send';
+
+/**
+ * Collapse key (Arbitrary string used to collapse a group of like messages when
+ *  the device is offline, so that only the last message gets sent to the client)
+ * @global String $config['gcm']['collapse_key']
+ */
+$config['gcm']['collapse_key'] = '';
+
+/**
+ * Username
+ * @global String $config['gcm']['username']
+ */
+$config['gcm']['username'] = '';
+
+/**
+ * Password
+ * @global String $config['gcm']['password']
+ */
+$config['gcm']['password'] = '';
+
+/**
+ * Path to log-file for logging PUSH errors
+ * @global String $config['gcm']['log']
+ */
+$config['gcm']['log'] = '/var/log/httpd';
+
+?>
\ No newline at end of file
diff --git a/src/Lunr/Core/C2DM.php b/src/Lunr/Core/C2DM.php
deleted file mode 100644
index b0017387c4c1216742cb293d4d33a5fd755ebfe3..0000000000000000000000000000000000000000
--- a/src/Lunr/Core/C2DM.php
+++ /dev/null
@@ -1,211 +0,0 @@
-<?php
-
-/**
- * This file contains the class C2DM which stands for Android Cloud To Device Messaging
- * framework. This class allows to send push notifications to Android devices.
- *
- * PHP Version 5.3
- *
- * @category   Libraries
- * @package    Core
- * @subpackage Libraries
- * @author     Jose Viso <jose@m2mobi.com>
- * @copyright  2011-2013, M2Mobi BV, Amsterdam, The Netherlands
- * @license    http://lunr.nl/LICENSE MIT License
- */
-
-namespace Lunr\Core;
-
-use Lunr\Network\Curl;
-
-/**
- * Android (C2DM) Push Notifications System Library
- *
- * @category   Libraries
- * @package    Core
- * @subpackage Libraries
- * @author     Jose Viso <jose@m2mobi.com>
- */
-class C2DM
-{
-
-    /**
-     * Id of sent push notification
-     * @var String
-     */
-    private $id;
-
-    /**
-     * Curl error message
-     * @var String
-     */
-    private $errmsg;
-
-    /**
-     * HTTP status code of the request made
-     * @var Integer
-     */
-    private $http_code;
-
-    /**
-     * Constructor.
-     */
-    public function __construct()
-    {
-        global $config;
-        include_once 'conf.c2dm.inc.php';
-        // default: no error
-        $this->errmsg = '';
-
-        // default: no ID
-        $this->id = '';
-
-        // set http_code to zero to indicate we haven't made a request yet
-        $this->http_code = 0;
-    }
-
-    /**
-     * Destructor.
-     */
-    public function __destruct()
-    {
-        unset($this->errmsg);
-        unset($this->id);
-        unset($this->http_code);
-    }
-
-    /**
-     * Get access to certain private attributes.
-     *
-     * This gives access to errmsg, id and http_code.
-     *
-     * @param String $name Attribute name
-     *
-     * @return mixed $return Value of the chosen attribute
-     */
-    public function __get($name)
-    {
-        switch ($name)
-        {
-            case 'errmsg':
-            case 'id':
-            case 'http_code':
-                return $this->{$name};
-                break;
-            default:
-                return NULL;
-                break;
-        }
-    }
-
-    /**
-     * Get authorization token.
-     *
-     * @param String $username User's email address
-     * @param String $password User's password
-     * @param String $source   Text to identify the application, for login purpose
-     *
-     * @return String authToken, FALSE otherwise
-     */
-    public function get_auth_token($username, $password, $source = '')
-    {
-        global $config;
-
-        $post_fields                = array();
-        $post_fields['accountType'] = urlencode($config['c2dm']['account_type']);
-        $post_fields['Email']       = urlencode($username);
-        $post_fields['Passwd']      = urlencode($password);
-        $post_fields['source']      = urlencode($source);
-        $post_fields['service']     = 'ac2dm';
-
-        $curl = new Curl();
-        $curl->set_option('CURLOPT_HEADER', TRUE);
-        $response = $curl->post_request($config['c2dm']['request_token_url'], $post_fields);
-
-        if (strpos($response, '200 OK') === FALSE)
-        {
-            return FALSE;
-        }
-
-        // Look for the authToken
-        preg_match('/(Auth=)([\w|-]+)/', $response, $matches);
-
-        if (!$matches[2])
-        {
-            unset($curl);
-            return FALSE;
-        }
-
-        unset($curl);
-        return $matches[2];
-    }
-
-    /**
-     * Send Android push notification based on registration ID and authToken.
-     *
-     * @param String $registrationID The registration ID retrieved from the app on the phone.
-     * @param String $authToken      The authorization token.
-     * @param String $message        The message that will be sent.
-     *
-     * @return Boolean, TRUE on success and FALSE otherwise
-     */
-    public function send_android_push($registrationID, $authToken, $message)
-    {
-        global $config;
-
-        $header       = 'Authorization: GoogleLogin auth=' . $authToken;
-        $collapse_key = $config['c2dm']['collapse_key'];
-
-        $data = array(
-            'registration_id' => $registrationID,
-            'collapse_key'    => $collapse_key,
-            'data.message'    => $message
-        );
-
-        $curl = new Curl();
-        $curl->set_option('CURLOPT_HEADER', TRUE);
-        $curl->set_http_header($header);
-
-        $returned_data   = $curl->post_request($config['c2dm']['google_send_url'], $data);
-        $this->http_code = $curl->http_code;
-
-        if ($returned_data === FALSE)
-        {
-            if($curl->http_code == 401)
-            {
-                $this->errmsg = 'Authorization token invalid';
-            }
-
-            if($curl->http_code == 503)
-            {
-                $this->errmsg = 'Server temporarily unavailable';
-            }
-            else
-            {
-                $this->errmsg = 'Error sending notification';
-            }
-        }
-        else
-        {
-            $result = substr($returned_data, $curl->info['header_size']);
-            if(stripos($result, 'id') !== FALSE)
-            {
-                $result   = str_replace('id=', '', $result);
-                $this->id = $result;
-                unset($curl);
-                return TRUE;
-            }
-            else
-            {
-                $result       = str_replace('Error=', '', $result);
-                $this->errmsg = $result;
-            }
-        }
-
-        unset($curl);
-        return FALSE;
-    }
-
-}
-
-?>
diff --git a/src/Lunr/Core/GCM.php b/src/Lunr/Core/GCM.php
new file mode 100644
index 0000000000000000000000000000000000000000..03cc59ac3cb05e2420b92b9e4c7a6fd4548f232d
--- /dev/null
+++ b/src/Lunr/Core/GCM.php
@@ -0,0 +1,176 @@
+<?php
+
+/**
+ * This file contains the class GCM which stands for Google Cloud Messaging
+ * framework. This class allows to send push notifications to Android devices.
+ *
+ * PHP Version 5.3
+ *
+ * @category   Libraries
+ * @package    Core
+ * @subpackage Libraries
+ * @author     Jose Viso <jose@m2mobi.com>
+ * @author     Leonidas Diamantis <leonidas@m2mobi.com>
+ * @copyright  2011-2012, M2Mobi BV, Amsterdam, The Netherlands
+ * @license    http://lunr.nl/LICENSE MIT License
+ */
+
+namespace Lunr\Core;
+
+use Lunr\Network\Curl;
+
+/**
+ * Android (GCM) Push Notifications System Library
+ *
+ * @category   Libraries
+ * @package    Core
+ * @subpackage Libraries
+ * @author     Jose Viso <jose@m2mobi.com>
+ * @author     Leonidas Diamantis <leonidas@m2mobi.com>
+ */
+class GCM
+{
+
+    /**
+     * Id of sent push notification
+     * @var String
+     */
+    private $id;
+
+    /**
+     * Curl error message
+     * @var String
+     */
+    private $errmsg;
+
+    /**
+     * HTTP status code of the request made
+     * @var Integer
+     */
+    private $http_code;
+
+    /**
+     * Constructor.
+     */
+    public function __construct()
+    {
+        global $config;
+        include_once 'conf.gcm.inc.php';
+        // default: no error
+        $this->errmsg = '';
+
+        // default: no ID
+        $this->id = '';
+
+        // set http_code to zero to indicate we haven't made a request yet
+        $this->http_code = 0;
+    }
+
+    /**
+     * Destructor.
+     */
+    public function __destruct()
+    {
+        unset($this->errmsg);
+        unset($this->id);
+        unset($this->http_code);
+    }
+
+    /**
+     * Get access to certain private attributes.
+     *
+     * This gives access to errmsg, id and http_code.
+     *
+     * @param String $name Attribute name
+     *
+     * @return mixed $return Value of the chosen attribute
+     */
+    public function __get($name)
+    {
+        switch ($name)
+        {
+            case 'errmsg':
+            case 'id':
+            case 'http_code':
+                return $this->{$name};
+                break;
+            default:
+                return NULL;
+                break;
+        }
+    }
+
+    /**
+     * Send Android push notification based on registration ID and authToken.
+     *
+     * @param String $registrationID    The registration ID retrieved from the app on the phone.
+     * @param String $authToken         The authorization token, now the GCM API key.
+     * @param String $notification_info An associative array which holds any information about
+     *                                  the notification to be sent to the user (message, id etc)
+     *
+     * @return Boolean, TRUE on success and FALSE otherwise
+     */
+    public function send_android_push($registrationID, $authToken, $notification_info)
+    {
+        global $config;
+
+        $headers = array('Content-Type:application/json', 'Authorization:key=' . $authToken);
+        $collapse_key = $config['gcm']['collapse_key'];
+
+        $payload = array(
+            'registration_ids' => array($registrationID),
+            'collapse_key'     => $collapse_key,
+            'data'             => $notification_info
+        );
+
+        $curl = new Curl();
+        $curl->set_option('HEADER', TRUE);
+        $curl->set_http_headers($headers);
+
+        $returned_data   = $curl->simple_post($config['gcm']['google_send_url'], json_encode($payload));
+        $this->http_code = $curl->http_code;
+
+        if ($returned_data === FALSE)
+        {
+            if($this->http_code == 401)
+            {
+                $this->errmsg = 'Authorization token invalid';
+            }
+            elseif ($this->http_code == 400)
+            {
+                $this->errmsg = 'Bad request';
+            }
+            elseif($this->http_code == 503)
+            {
+                $this->errmsg = 'Server temporarily unavailable';
+            }
+            else
+            {
+                $this->errmsg = 'Error sending notification' . 'Code: ' . $this->http_code . "\n";
+            }
+        }
+        else
+        {
+            $result = substr($returned_data, $curl->info['header_size']);
+            if(stripos($result, 'multicast_id') !== FALSE)
+            {
+                $decoded_result = json_decode($result);
+                $this->id       = $decoded_result['multicast_id'];
+
+                unset($curl);
+                return TRUE;
+            }
+            else
+            {
+                $result       = str_replace('Error=', '', $result);
+                $this->errmsg = $result;
+            }
+        }
+
+        unset($curl);
+        return FALSE;
+    }
+
+}
+
+?>
