> 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/merchant-tokenization/ja/sdk-tong-he/integration/ios.md).

# iOS

このガイドを使用して、を統合します **Thales SDK** iOSのマーチャントネイティブアプリケーションに。

## 配布パッケージ <a href="#delivery-packages" id="delivery-packages"></a>

SDK配布パッケージには以下が含まれます:

<table><thead><tr><th width="100">名前</th><th>説明</th></tr></thead><tbody><tr><td>バイナリ</td><td>Thales SDKのリリースおよびデバッグバリアント。</td></tr><tr><td>デモ</td><td>Thales SDKの統合方法と使用方法を示すサンプルプロジェクト。</td></tr><tr><td>Apidoc</td><td>Thales SDK APIドキュメント。</td></tr><tr><td>ライセンス</td><td>Thales SDKに同梱されているサードパーティフレームワークのライセンス。</td></tr></tbody></table>

## SDKを統合する <a href="#application-integration" id="application-integration"></a>

1. というフォルダを作成します `Framework`.
2. をコピーします `.xcframework` バンドルをから `Binaries/<Release|Debug>/` へ `Framework` フォルダ。

<figure><img src="https://726786440-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9XBN1F9dv7Dl1ggilGWC%2Fuploads%2F1Al27wRwLunl33VNC5wn%2F%7BD0950155-1E30-4048-9AB8-BECA33DD521F%7D.png?alt=media&amp;token=89c1d7c3-18b4-47be-b214-17618919b8fc" alt=""><figcaption><p>例 <code>Framework</code> SDKを含むフォルダ <code>.xcframework</code> バンドル。</p></figcaption></figure>

3. をドラッグします `TMGSDK.xcframework` です。難読化の詳細は、 `SecureLogAPI.xcframework` から `Framework` フォルダへ **Frameworks, Libraries, and Embedded Content** ターゲット設定の中に。

<figure><img src="https://726786440-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9XBN1F9dv7Dl1ggilGWC%2Fuploads%2FDgvwYPbcfhcxhzZzeW30%2F%7BA118875C-6AE4-4235-84D8-DFAF82BCF815%7D.png?alt=media&amp;token=c1f141b2-c66f-4da8-aa4f-c3295ca975bb" alt=""><figcaption><p>アプリターゲットにSDKフレームワークを埋め込みます。</p></figcaption></figure>

4. アプリのFace ID使用説明を追加します `Info.plist`.

<figure><img src="https://726786440-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9XBN1F9dv7Dl1ggilGWC%2Fuploads%2FYslcGKA1PlD4Hq8UJoac%2F%7BE072420F-D529-4B48-B999-44222BA20FC1%7D.png?alt=media&amp;token=bbe5038a-0dc4-416f-9e73-d6fefd87fa16" alt=""><figcaption><p>にFace ID使用説明を追加します <code>Info.plist</code>.</p></figcaption></figure>

## SDKを構成する <a href="#sdk-configuration" id="sdk-configuration"></a>

SDKのいかなるAPIを呼ぶ前にもThales SDKを構成してください。

を作成します `TMGClientConfiguration` 必要なパラメータで:

* サーバーURL
* サーバー証明書
* キー識別子
* 証明書PIN

#### 1. を作成します `TMGClientConfiguration`

オンボーディング中にサーバーURL、サーバー証明書、およびキー識別子を取得します。

```swift
let serverURL = ""
let serverCertificate = ""
let serverKeyID = ""
let configuration = TMGClientConfiguration(serverURL: serverURL,
                                           serverCertificate: Data(serverCertificate.utf8),
                                           serverKeyID: serverKeyID)
```

#### 2. を作成します `VisaCTFHelper`

Visa CTFおよびDAFのデバイスバインディング開始とトランザクション認証のためのヘルパーを作成します。

```swift
do {
      let visaCTFHelper = try TMGClient.sharedInstance.createVisaCTFHelper(withConfiguration: configuration)
} catch let error {
  // エラーを処理します
}
```

#### 3. を作成します `MastercardTAFHelper`

Mastercard TAFのデバイスバインディング開始とトランザクション認証のためのヘルパーを作成します。

```swift
do {
      let mastercardTAFHelper = try TMGClient.sharedInstance.createMastercardTAFHelper(withConfiguration: configuration)
  } catch let error {
      // エラーを処理します
  }
```

SDKがヘルパーを作成できない場合、エラーをスローします。

{% hint style="info" %}
SDKの各バリアントは意図された環境でのみ使用してください。を作成すると、SDKはを返します `VisaCTFHelper`、SDKはを返します `deviceEnvironmentUnsafe` 次の場合:

* `デバッグ`: アプリに配布またはアドホックの証明書で署名しています。
* `リリース`: アプリをデバッグしている、またはXcodeから起動している、もしくは `xcodebuild`. このエラーが発生した場合は、デバッグを停止してデバイスでアプリを再起動してください。
  {% 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/merchant-tokenization/ja/sdk-tong-he/integration/ios.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.
