> 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/classic-push-provisioning/ja/ysuksu/to/raifusaikuru.md).

# 制御: ライフサイクル操作

イシュアアプリケーションが消費者の検証を行った後、トークンの状態（サスペンド、再開、削除、またはアクティベート）を更新できます。Push Provisioning SDK はイシュアアプリケーションがこのリクエストを管理することを可能にします。SDK はリクエストを TSH に送信し、その後直接 TSP に送信します。

参照 [認可コード（JWT 形式）](/classic-push-provisioning/ja/gaido/dtanoto/kdojwt.md) のための `認可コード` このプロセスに必要です。\` `sub` クレームはトークン参照でなければなりません。

> <i class="fa-info-circle">:info-circle:</i>
>
> #### 注意 <a href="#note" id="note"></a>
>
> * Push Provisioning SDK は特定のライフサイクル操作がトークンに対して許可されているかどうかをチェックしません。
> * イシュアアプリケーションは操作を呼び出す前にトークンの状態を検証する必要があるかもしれません。例えば、Activate アクションはトークンが [PENDING\_IDV](https://thalesgroup.github.io/d1sdk-docs/tpc-sdk/android/latest/com/thalesgroup/tpcsdk/model/Token.html#getState\(\)) 状態であることを要求します。
>   * Apple Pay： [requiresActivation](https://developer.apple.com/documentation/passkit/pksecureelementpass/passactivationstate/requiresactivation) 状態であることを要求します。
>   * Google Pay： [GOOGLE\_PAY\_TOKEN\_STATE\_NEEDS\_IDENTITY\_VERIFICATION](https://thalesgroup.github.io/d1sdk-docs/tpc-sdk/android/latest/com/thalesgroup/tpcsdk/provisioning/CardDigitizationStatus.html#GOOGLE_PAY_TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION)
>   * Samsung Pay： [SAMSUNG\_PAY\_PENDING\_PROVISION](https://thalesgroup.github.io/d1sdk-docs/tpc-sdk/android/latest/com/thalesgroup/tpcsdk/provisioning/CardDigitizationStatus.html#SAMSUNG_PAY_PENDING_PROVISION)

<figure><img src="/files/c272f3c03634561163fb1528b29c55e87e0430f1" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="iOS" %}

```swift
// SCHEME が VISA の場合にのみ関連、MASTERCARD の場合は空文字を入れる
let tokenRequestorId = "40010030273" // Visa 用の Apple Pay

let scheme = "SCHEME" // VISA、MASTERCARD、AMEX
let authorizationCode = "<JWT>" // 特定のカードに関連する JWT 値を指定（イシュアのバックエンドから取得）
let tokenId = pass.secureElementPass?.deviceAccountIdentifier // または `Token.id` から取得可能

TPCSDK.updateTokenState(tokenId: tokenId,
                        tokenRequestorId: tokenRequestorId,
                        schemeString: scheme,
                        authorizationCode: authorizationCode,
                        action: .Activate) { success, error in
    if let error = error {
      // TPC エラーを処理
    } else if success {
      // todo: カードのデジタル化状態を示すために UI を更新
    }
}
```

{% endtab %}

{% tab title="Android" %}

```java
// SCHEME が VISA の場合にのみ関連、MASTERCARD の場合は空文字を入れる
String tokenRequestorId = "40010075001"; // Google Pay 用、または Samsung Pay 用は "40010043095"

String tokenId = "tokenId";
String scheme = "SCHEME"; // VISA、MASTERCARD
String authorizationCode = "<JWT>"; // 特定のカードに関連する JWT 値を指定（イシュアのバックエンドから取得）

TPCManager.getInstance().getTSHProxy().updateTokenState(tokenId,
        tokenRequestorId,
        scheme,
        authorizationCode,
        TokenAction.ACTIVATE,
        new TPCSDKListener<Boolean>() {
            @Override
            public void onStart() {
                // 開始時の処理
            }

            @Override
            public void onSuccess(TPCResult<Boolean> result) {
                Log.i(TAG, "Token State Updated");
                Boolean status = result.getResult();

                // TODO: 新しいステータスに合わせて UI を更新
            }

            @Override
            public void onError(TPCSDKException exception) {
                Log.e("TAG", "updateTokenState request Error = " + exception.getMessage());
            }
        });
```

{% endtab %}
{% endtabs %}


---

# 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/classic-push-provisioning/ja/ysuksu/to/raifusaikuru.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.
