Integrating Firebase Cloud Messaging with your application

 1. Setting up the project

  • Create a Firebase project in the Firebase console. The link will redirect you to the console, and click Create New Project.
  • Click Add Firebase to your Android app.
  • A window will appear asking you for your application’s package name:

Screen_Shot_2017-04-10_at_4.28.28_PM.png

 

  • The package name should match the one indicated in the AndroidManifest.xml file in your project directory as shown below:

    Screen_Shot_2017-04-10_at_1.36.03_PM__1_.png

  • After adding the application to the Firebase console, you will be prompted to download a google-services.json file. Download and place the file in the app/ directory of your project.

2. Adding Firebase support to Android studio project.

  • Add the following rules to your root-level build.gradle file, to enable google-services plugin:

    Screen_Shot_2017-04-10_at_4.38.36_PM.png

  • In your app-level Gradle file (app/build.gradle), add the apply plugin at the bottom, and also add the Firebase dependency:

    Screen_Shot_2017-04-10_at_4.39.56_PM__1_.png

 
3. Uploading the API key to Skillz 

  • Go to https://console.firebase.google.com/, and select your project.
  • Select Settings (top left corner of the console)

    Screen_Shot_2017-04-10_at_4.48.59_PM__1_.png

  • Select Cloud messaging tab
  • You will see the server key, copy the server key
  • Go to your Skillz developers console and select 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:

    Screen_Shot_2017-05-12_at_10.51.14_AM.png