> 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. アプリケーションで 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, and the optional `goal` 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>&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.
