WordPress GCM Plugin


Before we can start, you need an API Key. If you already know, hot to obtain one, jump to 7, else follow these steps:

1. You need a Google Account. If you already have one, go to the Google Api Console, and login. Create a new Project if you haven't already.

2. Now select your Project and go to "APIs & auth" > "APIs" and activate "Google Cloud Messaging for Android"

3. No you need youir API Key. Tp get one navigate to "APIs &auth" > "Credentials". Then click on "Create new Key".

4. Now this step is very important: Click on "Browser key", not on "Server key".

5. Just enter your Domain like below an press "Create"

6. Now you will see you Api Key. Copy the line "API KEY" highlited below. This is your API Key

7. Now open your WordPress Admin Backend, on go to "GCM" > "Settings". Enter in the Api Key Field your Api Key and press "Save Changes"

8. Your done!

Now the Plugin comes with 3 different Message Types out of the box. 
The first one you already know, its the normal "message" one. The two others are "new_post" and "update".

As GCM sends Messages in Json format it needs two attributes. The first Parameter ist the message type, the second one is the data. 
 

For example, if the message type is "message" it will include the data "message", containing the message.
But if the message type is "update" or "new_post", it will include the data: "post-title; post-url; post-id; post_author;".

So if a new post will be published, it automatically sends a GCM-Message containing the post title, url, id and author.

If you want to Create your custom Plugin Message Type and Message, all you need is to add a function called xy:

function xy () {
 
  $messageData = "Hello wolrd!";
  $messageType = "myType";
 
px_sendGCM($messageData, $messageType);
}
This is all you need. Just Call px_sendGCM($param1, $param2);
GPLv3 http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
 
Copyright 2014 Pixelart and Deniz Celebi  (email : office@pixelartdev.com)
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License, version 2, as 
    published by the Free Software Foundation.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

WordPress Plugin Page : http://wordpress.org/plugins/wp-gcm

WordPress Plugin Support: https://wordpress.org/support/plugin/wp-gcm

Plugin Homepage: http://pixelartdev.com/referenz/wp-google-cloud-messaging-plugin (German)

Please Rate at WordPress Plugin Page!

Donate if you are happy with my plugin and motivate me for more!