# iOS SDK

{% hint style="danger" %} <mark style="color:red;">**Warning!**</mark>

Please note! We will be not able to receive and show your data without this step!
{% endhint %}

To connect your iOS app to Appflow\.ai console you need to follow 3 steps during onboarding or using Settings=>Applications=>New Application

<figure><img src="/files/sP1ectZ8GWXuAxJBWJLm" alt=""><figcaption></figcaption></figure>

### **1. Download app token**

**First step** is to download the app token. Download this file and put into the root of your Xcode project. If prompted, select to add the config file to all targets.

### **2. Install SDK**&#x20;

The second step is to install SDK. AppflowSDK provides only one integration method for iOS developers: Pass through CocoaPods integrated

**Pass through CocoaPods integrated**

```swift
target 'MyApp' do
    use_frameworks!
    pod 'AppflowSDK', '~> 1.0.7'
end
```

**Save and execute pod install**, then open the project with a file suffixed with .xcworkspace.&#x20;

```swift
pod install
```

Notice: Execute pod search AppflowSDK under the command line. If the displayed version of **AppflowSDK** is not the latest, execute the pod repo update operation to update the content of the local repo. For more information on CocoaPods please see <https://cocoapods.org/>

### **3. Initialize SDK**&#x20;

The third step is to Initialize SDK and Set it up

**Add configuration file**

a. Download the appflow-app-token.json file, Add to targets to the project.&#x20;

b. Select Copy Items if needed.&#x20;

c. Create groups.&#x20;

d. Add to targets.

**import header file**&#x20;

Import the header file in the project's AppDelegate file&#x20;

```swift
import AppflowSDK
```

**Setup**&#x20;

```swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    //AppflowSDK initialization
    Appflow.shared.configure()
    return true
}
```

**Enable SDK log (optional)**&#x20;

You can enable SDK log output before initializing the SDK

```swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.

    //AppflowSDK initialization
    Appflow.shared.configure()
    //Whether to enable in-app purchase related logs, the default is not
    Appflow.shared.setPurchasesLogs(enabled: true)
    //Whether to enable the log related to the buried point, the default is not
    Appflow.shared.setAnalyticsLogs(enabled: true)
    return true
}
```

{% hint style="danger" %} <mark style="color:red;">**CALL APIs**</mark>

To get all info, please, follow the next steps of the release checklist so you will get all data into the dashboard
{% endhint %}

{% hint style="info" %} <mark style="color:blue;">**Note**</mark>

Please, also follow the next step - adding keys for the RTDN access
{% 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://doc.appflow.ai/docs/sdk-set-up-instructions/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.
