> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gameball.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Push Notifications

> Integrate Gameball push notifications to keep your customers informed about updates and rewards

Gameball uses Firebase and Huawei services to deliver maximum experience in your app. This includes push notifications, interactive in-app messaging. This depends on the initialization method mentioned earlier [here](/installation-guides/v2/android/getting-started#initialize-push-notifications), retrieving either Firebase or Huawei device tokens.

## Configure Gameball With Firebase

Before you start, you must configure your Firebase on your Gameball account. Follow the steps in [Configure your Firebase account on Gameball for mobile push notifications](https://help.gameball.co/en/articles/3522353-configure-your-firebase-account-on-gameball-for-mobile-push-notifications) article from our Help Center related to push notifications.

## Handling Push Notifications Integration

First, Implement the ***FirebaseMessagingService*** Interface and Implement your logic in the ***onMessageReceived*** override method.

<CodeGroup>
  ```java Java theme={null}
  public class FCMNotificationHandler extends FirebaseMessagingService {
      @Override
      public void onMessageReceived(@NonNull RemoteMessage message) {
          super.onMessageReceived(message);
          //TODO Handle received notification
      }
  }
  ```

  ```kotlin Kotlin theme={null}
  class NotificationsHandler: FirebaseMessagingService() {
      override fun onMessageReceived(message: RemoteMessage) {
          super.onMessageReceived(message)
          //TODO Handle received notification
      }
  }
  ```
</CodeGroup>

Then, Register the service under ***application*** tag in the app's Manifest file.

```xml theme={null}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <application>
        <activity>
            ...
        </activity>
        <service
            android:name=".FCMNotificationHandler"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
    </application>

</manifest>
```

Your customers can now receive push notifications from Gameball Through Firebase FCM.

<Info>
  Follow [this guide](https://firebase.google.com/docs/cloud-messaging/android/client) to learn more on how to Set up a Firebase Cloud Messaging client app on Android and [this guide](https://firebase.google.com/docs/cloud-messaging/android/receive) to learn more on how to Receive messages in an Android app.
</Info>

## Configure Gameball With Huawei

<Info>
  Follow these guides on how to integrate with Huawei Push Kit services:

  * [Configuring App Information in AppGallery Connect](https://developer.huawei.com/consumer/en/doc/hmscore-guides/android-config-agc-0000001050170137)
  * [Pushkit Codelab](https://developer.huawei.com/consumer/en/codelab/HMSPushKit/index.html#0)
</Info>

## Handling Push Notifications Integration

First, Implement the **HuaweiMessagingService** Interface and Implement your logic in the ***onMessageReceived*** override method.

<CodeGroup>
  ```java Java theme={null}
  public class HMSNotificationHandler extends HmsMessageService {
      @Override
      public void onMessageReceived(RemoteMessage remoteMessage) {
          // TODO Handle Huawei message here
      }
  }
  ```

  ```kotlin Kotlin theme={null}
  class MyHuaweiMessagingService : HmsMessageService() {
      override fun onMessageReceived(remoteMessage: RemoteMessage) {
          // TODO Handle Huawei message
      }
  }
  ```
</CodeGroup>

Then, Register the service under ***application*** tag in the app's Manifest file.

```xml theme={null}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <application>
        <activity>
            ...
        </activity>
        <service
            android:name=".HMSNotificationHandler"
            android:exported="false">
            <intent-filter>
                <action android:name="com.huawei.push.action.MESSAGING_EVENT" />
            </intent-filter>
        </service>
    </application>

</manifest>
```

Your customers can now receive push notifications from Gameball through Huawei Push Kit.

## Next Steps

* [Go-Live Checklist](/installation-guides/v2/android/go-live-checklist)
