# Configuring Android Push Notifications

> \[!CAUTION]
>
> Twilio deprecated Notify in October 2022 and no longer supports it. Learn more about [transitioning off Notify](https://support.twilio.com/hc/en-us/articles/11746930233115-Transitioning-off-Notify).
>
> If you're starting a new project, use [Programmable Messaging](/docs/messaging) for SMS notifications. For push notifications, integrate directly with platform-specific services such as APNs for iOS or FCM for Android. If you've already built on Notify, visit the [transition guide](https://support.twilio.com/hc/en-us/articles/11746930233115-Transitioning-off-Notify) to learn about your options.

In this guide, we'll go through all the necessary steps to get your Android push credentials configured with Twilio Notify. The end result is a properly configured Android app and a Twilio Notify Push Credential which you can then use to send notifications to your Android app. Let's get started!

## Step 1 - Create a project on Firebase

Google has replaced Google Cloud Messaging (GCM) with Firebase Cloud Messaging (FCM). To use push notifications for your Android apps, you will need to create a project on the [Firebase Console](https://console.firebase.google.com/):

![Form to create a Firebase project with fields for project name and country selection.](https://docs-resources.prod.twilio.com/ba69aca291a7222738a751abdca1019cf40d7557c75a6af24f589bba3453589d.png)

## Step 2 - Create a Configuration File

The Firebase Cloud Messaging (FCM) library requires a file called `google-services.json` in your Android project's app directory to link your app with Firebase services. You can generate this file in the Firebase console or using Android Studio's Firebase integration. We'll use the web-based approach in this guide.

After you create a Firebase project, you can add Firebase to your Android app:

![Firebase setup screen for Android app with fields for package name and app nickname.](https://docs-resources.prod.twilio.com/7f1d0b91eaf598e2422f2569dc145737278b08b6d2ba7056670611dec40fac72.png)

Clicking the middle link will bring up this dialog:

![Add Firebase To Your Android App.](https://docs-resources.prod.twilio.com/14615b2f10218d86ab58552099ad03f6b180216bbb9469a3871774d72696691a.png)

After filling in your Android app's package name, clicking the Add App button will automatically download the generated `google-services.json` file.

You will need to put that file into the `app` folder of your Android project, or Gradle won't be able to build your application after you add the Firebase libraries.

The next screen in the Firebase dialog will also explain where to put the file you just downloaded.

## Step 3 - Set up your project's dependencies

> \[!NOTE]
>
> You can skip this step if using the Quickstart app.
>
> We have already pre-configured the quickstart app so you can just [skip ahead to creating a credential](#step-5---upload-your-api-key-to-twilio).

Android Studio uses [Gradle](https://gradle.org/) to parse your credentials from the `google-services.json` file. Your app has 2
`build.gradle` files, a project-level one and an app-level one.

Add this line to your project-level `build.gradle` in the dependencies section:

```bash
compile "com.google.firebase:firebase-messaging:10.0.1"
```

## Step 4 - Edit the Application Manifest

> \[!NOTE]
>
> You can skip this step if using the Quickstart app.
>
> We have already pre-configured the quickstart app so you can just [skip ahead to creating a credential](#step-5---upload-your-api-key-to-twilio).

To fully integrate your application with Firebase Cloud Messaging, you'll need to create two application-specific Android Services, and then add them to your `AndroidManifest.xml` file. Check out the quickstart app for an example of each of these services.

The first service to add is a messaging service that responds to Firebase messaging events. This service must extend `com.google.firebase.messaging.FirebaseMessagingService` from the Firebase Cloud Messaging library.

```xml
<service
    android:name="com.example.ExampleMessagingService">
    <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT" />
    </intent-filter>
</service>
```

## Step 5 - Upload your API Key to Twilio

With our app configured to receive push notifications, we'll need to create a matching FCM Credential that our Notify Service can use. In Firebase the secret is called a **Server Key**, and you can find it in your Firebase console under your **Project Settings** and **Cloud Messaging** tab.

![Firebase Cloud Messaging settings showing server key and sender ID.](https://docs-resources.prod.twilio.com/3768e10f2b025184bac155f7c3459906b27f9346f132fe302689770c833ef3bd.png)

Having that, you'll need to create a credential on the [Add a Push Credential](/console/notify/credentials/create) page on the Twilio Console:

![Dialog for creating FCM push credential with fields for friendly name and FCM secret.](https://docs-resources.prod.twilio.com/05c8015480e23b361d240c2ac3aba6afafb2fa6dc45eec27a7114f2d3f8ac806.png)

From the drop-down, choose FCM and paste in your server key as the FCM Secret.

## Step 6 - Create a Notify Service

Twilio allows you to build multiple applications in a single account. To separate those applications you need to create Service instances that hold all the data and configuration for your application. On the [Notify Services](/console/notify/services) page of the Twilio Console, click the blue plus button to create a new Notify Service:

![Configure SDKStarterService with options for credentials and logging settings.](https://docs-resources.prod.twilio.com/71cecc5e4aa5141fb239035244c1f5a7d643a129f08c4650c78f012897446e1d.png)

After naming your Notify Service (for instance, with the same name as your app), you can configure the service to use one or more messaging credentials, such as the FCM Credential we created in Step 5:

![Configure your Notify Service.](https://docs-resources.prod.twilio.com/9423bfcb092c7f1dacc544ad0a5b578b264c736cf5520c476db27220a4567021.png)

You're now configured for Firebase Cloud Messaging, ready to write some code and send some push notifications with Twilio. Visit the [Android Quickstart](/docs/notify/quickstart/android) guide for the next step!
