# Android build configuration

### How to configure your Android build for push notification?

Send push notifications from within your app dashboard. To send notifications for your app, it is mandatory to configure your app build. Here’s a step-by-step guide on how to set it up for Android:

{% embed url="<https://scribehow.com/shared/Android_build_configuration__r9pURJ1KSEqnUOFIU9NLIg>" %}

#### **Step 1: Enable notification settings**

* Navigate to the [**Notification Build Settings**](https://app.appmysite.com/app/notifications/build-settings) screen in your AppMySite dashboard.
* Turn on the toggle for the type of notifications you want to configure:
  * Basic notifications
  * Advanced notifications
  * Both
* Click on Generate in the SHA-1 key field.

{% hint style="warning" %}
If you’re configuring basic notifications, you do not need to generate an SHA-1 key.
{% endhint %}

#### Step 2: Set up Google Firebase

* Navigate to [**Google Firebase** ](https://app.gitbook.com/o/fCq4VE0IF73XE6maLB4v/s/xUo90vXzDtbgOtaUaLYv/)and create a new project if you haven’t already set one up during the iOS build configuration.

{% hint style="danger" %}
If you have already set up a Firebase project for iOS notifications, you must use the same project for Android.
{% endhint %}

Refer to the guide to learn how to create a Firebase project.

{% content-ref url="../basic-notifications/create-firebase-project" %}
[create-firebase-project](https://docs.appmysite.com/app/notifications/basic-notifications/create-firebase-project)
{% endcontent-ref %}

* On the Project Overview screen, click on Add app and select Android.&#x20;
* Next, you’re required to enter your app package name. Navigate back to your AppMySite app dashboard and copy your Android app’s package name.&#x20;
* After adding your package name, enter a nickname for your app.&#x20;
* Paste the SHA-1 key you generated earlier on the Build Settings screen on AppMySite.&#x20;
* After proceeding to the next step, download the google-services.json file. Click on next again to complete the process.&#x20;
* Next, click on the gear icon next to Project Overview and select Project settings.&#x20;
* Navigate to the “Service accounts” tab.&#x20;
* Click on Generate new private key. Make sure node.js is selected. The key would be downloaded as a json file.

{% hint style="danger" %}
Your google-services.json file is essential for Firebase integration. Keep it safe, as you will need it for the next step.
{% endhint %}

#### **Step 3: Upload Firebase configuration files**

* Return to the Notification Build Settings screen in your AppMySite account.
* In the Google Firebase Configuration field, upload the google-services.json file.
* In the Google Firebase Service Account field, upload the .json key file.
* Click Save to complete the setup.

{% hint style="warning" %}
Make sure you upload the correct Firebase configuration files to avoid connectivity issues.
{% endhint %}

#### **Step 4: Generate a new Android app build**

* Once the configuration is complete, create a new build of your Android app.

{% hint style="warning" %}
If you are enabling only basic notifications, you do not need to generate the SHA-1 key.
{% endhint %}

* Download and install the new build on a test device to verify that push notifications work correctly.

{% hint style="warning" %}
Important notes

* Once your new build is live, notifications will start working automatically.
* If you face any issues, verify that you have uploaded the correct Firebase configuration files.
* You must rebuild and submit a new version of your app every time you modify notification settings.
  {% endhint %}

This setup ensures that your app is configured to send push notifications efficiently using Firebase.
