> 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/ja/get-started/configuration/5.-push-notifications/configure-push-provider.md).

# プッシュプロバイダーを構成する

## FCM の設定

Google のガイドに従ってください： [Android での FCM クライアント アプリの設定](https://firebase.google.com/docs/cloud-messaging/android/client).

概要として：

1. Firebase プロジェクトを作成し、Android アプリケーションを登録します。
2. Firebase を Android プロジェクトに追加します。
3. 次を拡張するサービスを実装します `FirebaseMessagingService`:
   1. オーバーライドします `onNewToken` プッシュトークンの更新をサポートするために
   2. オーバーライドします `onMessageReceived` NFC Wallet バックエンドからのプッシュ通知を処理するために。
4. アプリケーションのマニフェストでサービスを宣言します。

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

```java
public class FcmService extends FirebaseMessagingService {

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

        // 新しいトークンについて NFC Wallet SDK に通知します。
        updateToken(this, token);
    }

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

        // プッシュペイロードを共通ハンドラにルーティングします。
        processIncomingMessage(this, remoteMessage.getData());
    }
}
```

{% endcode %}

## HMS Push Kit の設定

Google Play サービスのない Huawei デバイスの場合は、HMS Push Kit を構成します。

Huawei のガイドに従ってください： [HMS Push Kit (Android) Codelabs](https://developer.huawei.com/consumer/en/codelab/HMSPushKit).

{% hint style="warning" %}
メッセージを正しくルーティングするには、HMS トークンに次の接頭辞を付けます `HMS:`.
{% endhint %}

概要として：

1. AppGallery Connect でアプリケーションの Push Kit を有効にします [AppGallery Connect](https://developer.huawei.com/consumer/en/service/josp/agc/index.html).
2. HMS Core SDK を次に統合します **デジタルウォレットアプリケーション**.
3. 次を拡張するサービスを実装します `HmsMessageService`:
   1. オーバーライドします `onNewToken` プッシュトークンの更新をサポートするために
   2. オーバーライドします `onMessageReceived` NFC Wallet バックエンドからのプッシュ通知を処理するために。
4. アプリケーションのマニフェストでサービスを宣言します。

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

```java
public class HmsService extends HmsMessageService {

    // HMS Push Kit トークンには「HMS:」プレフィックスを使用します
    private static final String HMS_TOKEN_PREFIX = "HMS:";

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

        // 新しいトークンについて NFC Wallet SDK に通知します。
        updateToken(this, HMS_TOKEN_PREFIX + token);
    }

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

        // プッシュペイロードを共通ハンドラにルーティングします。
        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:

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

The question should be specific, self-contained, and written in natural language.
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.
