> 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/release-notes/ja/sdk/2026-nian-9-yue/d1-sdk-4.5.0/d1-sdk-450-no-api.md).

# D1 SDK 4.5.0 の非同期 API

## D1 SDK 4.5.0 の非同期 API

#### 概要

D1 SDK 4.5.0 では、iOS 向けの非同期 API 更新が導入されます。

更新された API は Swift Concurrency をサポートします。

このガイドを使用して、影響を受ける API を確認し、イシュアアプリケーションを更新してください。

#### 変更点

以前の API サーフェスは、D1 SDK 4.5.0 で非推奨になりました。

イシュアアプリケーションで非同期呼び出しを使用している場合は、完了ハンドラーを Swift Concurrency API に置き換えてください。

このページでは、4.5.0 で変更された API を一覧表示します。

#### 移行先 `digitalCardService`

{% stepper %}
{% step %}
**現在の統合を確認する**

イシュアアプリケーションで使用されている非推奨の D1 SDK API を特定します。

現在次を通じて公開されている API に注目してください `digitalCardService`.
{% endstep %}

{% step %}
**初期化 `digitalCardService`**

初期化 `digitalCardService` から `d1Task` 更新された API を呼び出す前に。
{% endstep %}

{% step %}
**完了ハンドラーを置き換える**

各完了ハンドラー API を対応する `async throws` API に置き換えます。
{% endstep %}

{% step %}
**移行したフローを検証する**

移行後にイシュアアプリケーションをビルドしてテストします。

更新されたデジタルカードのフローを検証します。
{% endstep %}
{% endstepper %}

#### 非同期処理を更新する

イシュアアプリケーションで Swift Concurrency を使用している場合は、Swift Concurrency API を使用してください。

これにより、非同期コードの可読性と保守性が向上します。

`digitalCardService` 呼び出しでは現在 `async throws` 完了ハンドラーの代わりに使用されます。

#### 4.5.0 の API 変更

このセクションを使用して、D1 SDK 4.5.0 で変更された API を確認してください。

サービスを次から初期化します `d1Task` API を呼び出す前に。

```swift
let digitalCardService = try d1Task.digitalCardService()
```

#### `digitalCardService`

**`activateDigitalCard(withDigitalCardID:)`**

以前:

```swift
public func activateDigitalCard(withDigitalCardID digitalCardID: String,
                                   completion: @escaping (D1Error?) -> Void)
```

現在:

```swift
public func activateDigitalCard(withDigitalCardID digitalCardID: String) async throws
```

**`activateDigitalCard(_:)`**

以前:

```swift
public func activateDigitalCard(_ cardID: String,
                                   completion: @escaping (D1Error?) -> Void)
```

現在:

```swift
public func activateDigitalCard(_ cardID: String) async throws
```

**`digitalCardList(_:)`**

以前:

```swift
public func digitalCardList(_ cardID: String,
                               completion: @escaping ([DigitalCard]?, D1Error?) -> Void)
```

現在:

```swift
public func digitalCardList(_ cardID: String) async throws -> [DigitalCard]
```

**`updateDigitalCard(_:digitalCard:action:)`**

以前:

```swift
public func updateDigitalCard(_ cardID: String,
                                 digitalCard: DigitalCard,
                                 action: CardAction,
                                 completion: @escaping (Bool, D1Error?) -> Void)
```

現在:

```swift
public func updateDigitalCard(_ cardID: String,
                                 digitalCard: DigitalCard,
                                 action: CardAction) async throws
```


---

# 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/release-notes/ja/sdk/2026-nian-9-yue/d1-sdk-4.5.0/d1-sdk-450-no-api.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.
