> 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-ios/ja/additional-features/handle-visa-multiple-aids.md). Agents can also search and read this documentation through its [MCP server](https://docs.payments.thalescloud.io/~gitbook/mcp).

# Visa の複数 AID を処理する

## 概要

Visaの複数AIDを処理するには、NFC Wallet SDKを使用します。

利用可能なAIDを読み取ることができます。また、AIDの優先順位やロック状態も更新できます。

## SDKの統合

アプリケーション識別子（AID）は、 `DigitalCard.aidInfoList: [AIDInfo]`.

複数のAIDを検出するには、 `DigitalCard.isMultiAID: Bool`.

### AID情報を取得する

`DigitalCard.aidInfoList: [AIDInfo]` は、 `AIDInfo` オブジェクトの配列を返します。

各 `AIDInfo` には、AIDとメタデータが含まれます。

* `AIDInfo.aid`：AIDを表す `String`.
* `AIDInfo.label`：ラベルを表す `String`.
* `AIDInfo.lockStatus`：AIDの状態。 `.locked` または `.unlocked` （デフォルト）。

{% hint style="warning" %}
Visaカードのみがサポートされています。

Visa以外のカードで呼び出した場合：

* `DigitalCard.isMultiAID` は常に `false`.
* `DigitalCard.aidInfoList` および `DigitalCard.setAIDInfoList(_:)` は `clientError`.
  {% endhint %}

{% hint style="info" %}
端末は、ロックされたAIDに `6A81` を送信すると、ステータスワード **SELECT** を返します。
{% endhint %}

### AIDの優先順位とロック状態を更新する

更新後のリストを作成するときは、 `AIDInfo` オブジェクトを `aidInfoList` から使用します。

`AIDInfo.lockStatus` は変更可能です。また、リストの順序を入れ替えてAIDの優先順位を変更できます。

リストの先頭の要素が最も優先順位の高いAIDです。

AID 構成を更新するには、

1. 次の `DigitalCard.aidInfoList: [AIDInfo]` API を使用して、デジタルカードから `AIDInfo` を取得します。
2. 新しい配列を作成し、順序や `lockStatus`.
3. を更新します。更新を適用するには、 `DigitalCard.setAIDInfoList(_:)`.

{% hint style="warning" %}
新しいリストを設定する際は、同じ `AIDInfo` 要素を維持してください。

AIDやラベルを追加、削除、変更しないでください。そうしないと、 `DigitalCard.Error.aidInfoListMismatch` がスローされます。
{% endhint %}

### 例

この例では、AIDの順序を変更し、1つのAIDをロックします。

```swift
var aidInfoList = try await digitalCard.aidInfoList
let isMultiAID = try await digitalCard.isMultiAID
  
var newAIDInfoList: [AIDInfo] = []

// 必要に応じて項目の順序を変更します。
newAIDInfoList.append(aidInfoList[3])
newAIDInfoList.append(aidInfoList[0])
newAIDInfoList.append(aidInfoList[1])
newAIDInfoList.append(aidInfoList[2])

// 項目の順序を変更する必要がない場合は、
// 元のリストから新しいコピーを作成するだけで済みます。
newAIDInfoList = aidInfoList

// 必要に応じてAIDのlockStatusを変更します:
newAIDInfoList[0].lockStatus = .locked
newAIDInfoList[1].lockStatus = .unlocked

// 新しい`AIDInfo`オブジェクトの配列をdigitalCardに設定します:
try await digitalCard.setAIDInfoList(newAIDInfoList)
```

{% hint style="info" %}
`digitalCard.aidInfoList` のコピーを返します `AIDInfo`.

配列を変更してもデジタルカードは更新されません。変更を反映するには、 `setAIDInfoList(_:)` を呼び出してください。
{% endhint %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-ios/ja/additional-features/handle-visa-multiple-aids.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
