Android: Migrating to Firebase Cloud Messaging

If you are using v6.+ of the Android SDK in your app and have not yet migrated your project into the Firebase console, you will need to do so in order to continue to receive push notifications. Google provides a full guide to converting an app to use Firebase here.

However since some of these changes are already taken care of within the SDK, we have provided a summary below of the steps you will still need to complete in order to migrate your account and update your app.

Create a Firebase Project

You can find the firebase console here.

Signing into this console with the same credentials you have been using to sign into the Google Cloud Console will allow you to import your project directly. This will provide continuity for your push notification Server Keys, allowing both old and new versions of your app to receive push notifications from the same keys.

From main page of the Firebase console, just select 'Add project'.

490

You will then be presented with the following popup. From there you can import your existing project from the drop down list under 'Project name'.

540

Add Firebase to your Android App

Once the project has been created you will need to add Firebase to your Android app using the icon below, which can be found on the landing page of your new Firebase project.

684

You can then specify the package name of your app and register the app.

650

Once your app has been registered you should download the google-services.json and include this file in the base folder of your app. This provides the Firebase SDK with the details of your app and the corresponding Firebase project. You can then continue to the next step.

739

The Firebase dependency is already included in the SDK, however you will need to apply the google services plugin in your app level build.gradle, at the bottom of the file as recommended.

729

There is then an optional app verification stage that you can skip at this time.

729

Check Server Keys

Once the Android app has been added to the project, you can open the 'Project settings' from the menu.

469

Navigating to the Cloud Messaging section you should be able to see your server keys. The legacy server key and sender ID should match the values that you were using from the old Google Cloud Console project.

Your project should now be ready to work with Firebase Cloud Messaging.