SDK

Platform Configuration

Before you can start sending messages to Android, you will have to at least set up an FCM project and obtain a Google Maps key for Google Play Services based devices. This is all done via the Firebase Developer Console and Google Developer Console. Keep reading this document to know how to configure your push provider platform.

Creating a FCM Project

In 2016, Firebase Cloud Messaging replaced the GCM (Google's Cloud Messaging) and became Android's official push provider. To be able to send notifications you currently need to create a project in Firebase.

Start by signing in Firebase. In their developer page you will find a button like this one:

fcm new project button 2023

This will open a page like this one, where you should provide a name for your project:

fcm new project page 2023

Firebase will generate an ID for you project, but you can also customize it:

fcm project id 2023

Depending on the capabilities you want to add to your project, you might need to enable or disable some options.

After creating your project, you will automatically be redirected to the project area where you can find a button like this one:

fcm project settings 2023

In the project settings page you will find a tab for Cloud Messaging:

fcm project cloud messaging tab 2023

Service Account

For newly created apps, we recommend using the Firebase Cloud Messaging API. This API uses a Service Account which you can manage in the Google Cloud Console, by clicking in Manage Service Accounts:

fcm api manage service accounts 2023

In this page you will find a list of service accounts (Firebase should create one automatically, but you can always create new ones):

fcm service accounts list 2023

You should then click in the service account, and navigate to the Keys tab:

fcm service account keys tab 2023

Go ahead and click in Add Key, which should open a window as the one below:

fcm service account create key 2023

Select the JSON option and click Create. That should download a .json file to you computer.

You can then use that file and upload it to Notificare, in Settings > Services > FCM as the Service Account:

notificare fcm service account

Saving this change, will create an entry as follows:

notificare fcm service account ready 2023

After that, you are ready to start sending remote notifications to Android devices.

Google Maps Key

Optionally if you want our library to handle Google Maps correctly you will need to enable access to this API in the Google's Developer console. This is only necessary if you intend to send notifications that use the map capabilities and if you are not already using yourself a Google Maps key in your app. If you do not want to use this functionality or you already use Google Maps in your app you can skip this configuration.

To enable this API and generate a API key, sign in into the Google's Developer Console and select the app you which to enable this API:

google console app selector

Then click in the Library menu item like shown below:

google console library

This will take you to a page where you find all the Google APIs. Locate and click in the Google Maps Android API link:

google console maps api

In this page you'll a short explanation about this API and the Enable button:

google console enable maps

Clicking in Enable will allow your project access to this API and show you a page that looks like this:

google console maps api enabled

Then you are ready to create an API key that can actually be used in your app. In the menu on the left, click in Credentials:

google console credentials

In this page expand the Create Credentials menu and click in API key:

google console credentials api key menu

This will generate a key and display it in a window like the one below:

google console api key generated

In production you might want to restrict the access of this key to your app but we will not cover this setup in this document.

Once you have generated an API key for Google Maps, go ahead an add an entry in your app's AndroidManifest.xml as follows:

<meta-data
    android:name="com.google.android.geo.API_KEY"
    android:value="ADD_THE_KEY_HERE" />

You have now all the necessary platform configurations to start implementing our library. Keep reading our Implementation guides located here.