> 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/implement-nfc-wallet/manage-digital-cards/manage-digital-card-lcm.md).

# デジタルカードのLCMを管理する

## 概要

デジタルカードのライフサイクル（LCM）を管理するために、デジタルウォレットアプリケーションで NFC Wallet SDK を使用します。

主なユースケース:

* デジタルウォレットアプリケーションからデジタルカードを削除する

開始する前に、以下で説明されているようにアクセストークンを取得する必要があります [アクセストークンを取得する](/nfc-wallet-sdk-android/ja/implement-nfc-wallet/manage-digital-cards/get-an-access-token.md).

{% hint style="info" %}
このセクションでは、デジタルウォレットアプリケーションから開始される LCM アクションについて説明します。イシュアバックエンドは、TSP と直接デジタルカード LCM を開始することもできます。
{% endhint %}

## SDK 連携

使用する `MGCardLifeCycleManager` およびデジタルカード ID を使用して LCM アクションをトリガーします。

実装する `MGCardLifecycleEventListener` を処理するための `onSuccess` と `onError` コールバック。

サポートされているアクション:

* `deleteCard`
* `suspendCard`
* `resumeCard`

`onSuccess` は、NFC Wallet SDK がリクエストを受け入れたことを確認します。デジタルウォレットアプリケーションは、プッシュ通知を受信した後に更新されます。

{% hint style="info" %}
からの変更は **NFC Wallet バックエンド** デジタルウォレットアプリケーションにはすぐには表示されません。

**NFC Wallet バックエンド** は、デジタルカードの状態を同期するためにプッシュ通知を送信します。

参照 [プッシュ通知の処理](/nfc-wallet-sdk-android/ja/get-started/configuration/5.-push-notifications/handle-push-notifications.md).
{% endhint %}

### デジタルカードを削除する

を使用してデジタルカードを削除する `MGCardLifeCycleManager.deleteCard(...)`.

カードを削除すると、デジタルウォレットアプリケーションからそのカードが完全に削除されます。

{% code title="DeleteCard.java" %}

```java
// アクセストークンを取得します
String accessToken = "....";

// カードライフサイクルマネージャーを取得します。
MGCardLifeCycleManager cardLifeCycleManager = MGClient.getCardLifeCycleManager();

// デジタルカード ID を使用してカードを削除します。
cardLifeCycleManager.deleteCard(
    digitalCardId,
    new MGCardLifecycleEventListener() {
        @Override
        public void onSuccess(String digitalCardId) {
            /*
             * リクエストは NFC Wallet SDK に受け入れられました。
             * NFC Wallet バックエンドが、操作を完了するためのプッシュ通知を送信します。
             *
             * カードがサーバー側ですでに削除されている場合、SDK はローカルのカードデータを削除します。
             */
        }

        @Override
        public void onError(String digitalCardId, MobileGatewayError error) {
            /*
             * リクエストに失敗しました。
             * 原因を特定するには MobileGatewayError を確認してください。
             */
        }
    },
    null,
    null,
    accessToken );
```

{% endcode %}

{% hint style="info" %}
後、 **イシュアのバックエンドが** または **デジタルウォレットアプリケーション** が削除リクエストを開始すると、デジタルカードは一時的に次のように表示されることがあります `RETIRED`状態。

この間、 `DigitalizedCardManager#getAllCards()` は引き続きカードを返すことがあります。

SDK がローカルストレージからカードを削除すると、そのカードはリストから消えます。
{% endhint %}

### デジタルカードを一時停止する

を使用してデジタルカードを一時停止する `MGCardLifeCycleManager.suspendCard(...)`.

### デジタルカードを再開する

を使用してデジタルカードを再開する `MGCardLifeCycleManager.resumeCard(...)`.


---

# 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/implement-nfc-wallet/manage-digital-cards/manage-digital-card-lcm.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.
