> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/get-started/configuration/5.-push-notifications/configure-push-provider.md).

# Configure push provider

## Set up FCM

Follow Google’s guide: [Setting up a FCM client app on Android](https://firebase.google.com/docs/cloud-messaging/android/client).

At a high level:

1. Create a Firebase project and register your Android application.
2. Add Firebase to your Android project.
3. Implement a service extending `FirebaseMessagingService`:
   1. Override `onNewToken` to support the push token update
   2. Override `onMessageReceived` to handle push notification from NFC Wallet backend.
4. Declare the service in your application manifest.

{% code title="FcmService.java" expandable="true" %}

```java
public class FcmService extends FirebaseMessagingService {

    @Override
    public void onNewToken(@NonNull final String token) {
        super.onNewToken(token);

        // Notify the NFC Wallet SDK about the new token.
        updateToken(this, token);
    }

    @Override
    public void onMessageReceived(@NonNull final RemoteMessage remoteMessage) {
        super.onMessageReceived(remoteMessage);

        // Route the push payload to your common handler.
        processIncomingMessage(this, remoteMessage.getData());
    }
}
```

{% endcode %}

## Set up HMS Push Kit

For Huawei devices without Google Play services, configure HMS Push Kit.

Follow Huawei’s guide: [HMS Push Kit (Android) Codelabs](https://developer.huawei.com/consumer/en/codelab/HMSPushKit).

{% hint style="warning" %}
To route messages correctly, prefix HMS tokens with `HMS:`.
{% endhint %}

At a high level:

1. Enable Push Kit for your application in [AppGallery Connect](https://developer.huawei.com/consumer/en/service/josp/agc/index.html).
2. Integrate HMS Core SDK into your **digital wallet application**.
3. Implement a service extending `HmsMessageService`:
   1. Override `onNewToken` to support the push token update
   2. Override `onMessageReceived` to handle push notification from NFC Wallet backend..
4. Declare the service in your application manifest.

{% code title="HmsService.java" expandable="true" %}

```java
public class HmsService extends HmsMessageService {

    // Use "HMS:" prefix for HMS Push Kit token
    private static final String HMS_TOKEN_PREFIX = "HMS:";

    @Override
    public void onNewToken(final @NonNull String token) {
        super.onNewToken(token);

        // Notify the NFC Wallet SDK about the new token.
        updateToken(this, HMS_TOKEN_PREFIX + token);
    }

    @Override
    public void onMessageReceived(@NonNull final RemoteMessage remoteMessage) {
        super.onMessageReceived(remoteMessage);

        // Route the push payload to your common handler.
        processIncomingMessage(this, remoteMessage.getDataOfMap());
    }
}
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/get-started/configuration/5.-push-notifications/configure-push-provider.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
