# Prerequisites

### Creating an app

*Let's get going!*

The very first step is to go to [Batch's dashboard](https://dashboard.batch.com/) and create a new Android app.

![Registering a new app](https://38998153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCL8wF0y1T2vLnm3yR2MW%2Fuploads%2F2M99Uu7clJeVP8yDmjJy%2Fdashboard_new_app_screenshot.png?alt=media\&token=5f1c4b1f-38f7-43f2-b151-7f828dd0b49c)

Now let's generate your push keys and put them in Batch's dashboard.

### Getting your FCM Service Account Key

Here are the steps you need to take to find your FCM Service Account Key.

First, go to the [Firebase console](https://console.firebase.google.com). Once you are logged in, select your existing project or create a new one.

![Create New App](https://38998153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCL8wF0y1T2vLnm3yR2MW%2Fuploads%2F0TCuEePv4scEZXbjYq2d%2Ffirebase_create_new_app.png?alt=media\&token=d9d5e6e3-a594-45e9-a727-f1f00834a456)

Then, click the ⚙ next to your project name and *"Project settings"*. Click the *"Cloud Messaging"* tab.

If the *"Firebase Cloud Messaging API (V1)"* is marked as disabled, you will need to enable it by following these steps:

1. Click on the 3 dots next to *"Firebase Cloud Messaging API (V1)"*
2. Select "Manage API on Google Cloud Console"
3. A new tab will open. Click on *"Enable"*
4. Wait until the page reloads with a different content. A *"DISABLE API"* button should appear
5. Close the tab, go back on the Firebase settings and refresh the page
6. You should now be able to manage service accounts and service account keys

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCL8wF0y1T2vLnm3yR2MW%2Fuploads%2FDiNm2lgXkUJhlHOaZT4W%2Ffirebase_enable_cloud_messaging.mp4?alt=media&token=81daedd0-65b5-4306-9e02-6bf37315b67b>" %}

Next, click on the *"Service Accounts"* section.

From here, you'll be able to generate a key by clicking on the blue *"Generate new private key"* button.

It will be saved on your computer as a `.json` file.

{% hint style="warning" %}
Make sure you choose an existing project instead of creating a new one if you are migrating from an other push provider.
{% endhint %}

{% hint style="info" %}
If you're creating a service account key from the Google Cloud IAM & Admin console, please make sure the service account you're creating it from has the right role and permissions to create messages on Firebase. Currently only one permission is necessary : `cloudmessaging.messages.create`.
{% endhint %}

Configuring Batch Push

Now go to ⚙ Settings → Push Settings on Batch's dashboard and fill the **Service Account Key** field, either by drag & dropping the `.json` file or by selecting it from your computer.

![FCM Keys](https://38998153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCL8wF0y1T2vLnm3yR2MW%2Fuploads%2FLAKMMrKWw56hcgmXMJZC%2Fdashboard_fcm_keys.png?alt=media\&token=e47248bb-58d7-4ee1-bb1b-a9af99878dfa)

### License Attribution

As Batch uses open-source software, you must include attribution text in your application. This usually goes in a "Legal Notices" or "About" screen.

You can get the attribution text [here](https://github.com/BatchLabs/Batch-Android-SDK/blob/master/LICENSE.thirdparty).

{% hint style="info" %}
Batch provides the license text in the maven central artifact metadata. If you use a gradle plugin that automatically extract attributions from your dependencies, check if it didn't automatically add the attributions.
{% endhint %}
