Before the Android application is able to receive the notifications, you must authenticate yourself with Google as a developer. Luckily this is both easy and free to do, and doesn’t require much set-up. Like iOS, you are only able to test out your push notifications in a real device.

Registering with Google

First, we must authenticate with Google. Google offers the Google Cloud Messaging (GCM) platform, formerly known as Cloud to Device Messaging (C2DM). You will need a Google Account for this. Now open the Google Cloud Console.

  • If you haven’t created a project, click “Create Project”:

Create New Project
  • Now give the new project a name:

New Project Name
  • Once the project has been created you will see the overview screen. From there grab the project number (used later as the Sender ID):

Project Number

Now you need to enable the Google Cloud Messaging Android APIs. To do that, navigate to APIs & auth > APIs and scroll down to the Google Cloud Messaging Android item, which you need to turn on:

Project Number

Now we need to register our application and state that we are accessing the Google APIs from a Web Server, the AeroGear UnifiedPush Server in this case. First go to APIs & auth > Credentials and inside of the Public API access area click the red CREATE NEW KEY button. This launches the following popup, where you select the Server key option:

Project Number

On the next screen we just click the blue Create button to create our Server Key:

Project Number
  • For extra security, you may whitelist an IP address (or multiple) for the sending server

On the last screen we are finally get to see the actual value of the generated Server Key, which we will use later:

Project Number

Now that Google is ready to accept and deliver our messages, we are ready to setup the UnifiedPush server.