# \[iOS]ビジュアルトラッキングを利用する

ペアリングしたデバイスからKARTEに送信した操作ログを利用して、イベントの発火条件を定義できます。

定義したイベント発火条件は各デバイスに反映されるため、アプリケーションをリリースすることなく、イベントの発火をコントロールすることが可能になります。

{% hint style="warning" %}
**XCodeの対応バージョンについて**

KarteVisualTracking v2.12.0以降では、XCode 15以降での利用を想定しています。\
現時点でXCode 14系をご利用の場合は、KarteVisualTracking v2.11.0以下をご利用ください。
{% endhint %}

## 導入手順

1. Podfile の編集\
   プロジェクトディレクトリにある `Podfile` を任意のエディタで開き、`KarteVisualTracking` の Pod を追加します。

{% code title="Podfile" overflow="wrap" %}

```ruby
pod 'KarteVisualTracking'
```

{% endcode %}

2. Pod のインストール\
   プロジェクトディレクトで下記コマンドを実行し、Pod をインストールします。

{% code overflow="wrap" %}

```bash
pod install
```

{% endcode %}

## 実装手順

設定方法については [カスタムURLスキームを設定する](/ios-sdk-appendix/concepts-custom-url-scheme-ios-sdk.md) をご覧ください。

## 動作確認

2点の動作が確認できれば問題なく動作していることが確認できます。

1. ペアリングの確認
2. 定義に基づいたイベントの送信が行われているか確認

ペアリングをはじめとした各種操作方法については、サポートサイトの [ビジュアルトラッキング](https://support.karte.io/post/7JbUVotDwZMvl6h3HL9Zt7) をご覧ください。

{% hint style="info" %}
**ペアリングの動作について**

ペアリング開始後、SDKはペアリングを維持するために一定間隔で通信を行います。\
なおアプリケーションのプロセスが終了した場合は、ペアリングは解除されます。
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://app.developers.karte.io/ios-sdk/visual-tracking-ios-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
