Migrating from Google Cloud Messaging to Firebase Cloud Messaging

This is a guide to migrate your application from using Google Cloud Messaging to Firebase Cloud Messaging, or to deploy a fresh Firebase Cloud Messaging application.

Migration step:

(This guide is based on an article written by Google)

  • Importing Google Cloud Messaging project to Firebase


  • In the Firebase console, select Import Google Project.
  • Select your GCM project from the list of existing projects and select Add Firebase.
  • In the Firebase welcome screen, select Add Firebase to your Android App.
  • Provide your package name and SHA-1, and select Add App. A new google-services.json file for your Firebase app is downloaded.
  • Select Continue and follow the detailed instructions for adding the Google Services plugin in Android Studio.

You can replace step 1 by creating a new Firebase project on your own, if you don’t have an existing GCM project. But remember, the package name MUST match with the package name of your application declared in your AndroidManifest.xml:



The package name is always declared in the beginning of the manifest file, like this:


  • Download the google-services.json file in the Firebase console after you create your project from step a, and move that file to YOUR_APP_FOLDER/app. Here, YOUR_APP_FOLDER is the folder where you store your application, for example, /Users/yourname/AndroidStudioProjects

  • Adding Fire dependencies and removing GCM dependencies
    • Add the following to the end of app-level build.gradle, and the dependencies to support Firebase:


  • Add the following to the project-level build.gradle’s dependencies:

  • Remove the following permissions from AndroidManifest.xml:


  • Uploading API Key to Skillz. Screen_Shot_2017-04-10_at_4.48.59_PM.png

    • Select Cloud messaging tab
    • You will see the server key, copy the server key
    • Go to developers.skillz.com and then go to your application
    • Select the Push Notification tab on your left
    • In the Android - GCM Push notification, paste your server key to the blank text field, and hit Save: