> 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="/files/c829bfdbc48dfd6a53c5e2c08d12c3917e996980" 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="/files/a3215675cb7d64cbc00367a53126facb2c9609f5" alt=""><figcaption><p>アプリターゲットにSDKフレームワークを埋め込みます。</p></figcaption></figure>

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

<figure><img src="/files/b0fcb1a04f1725d65e17dd7e93fcbb070d93afe2" 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 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/merchant-tokenization/ja/sdk-tong-he/integration/ios.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.
