> For the complete documentation index, see [llms.txt](https://knowledgebase.offer18.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.offer18.com/ru/set/sdk/ios-sdk.md).

# iOS SDK

Чтобы реализовать метод Direct Manual Import для Offer18 iOS SDK, пожалуйста, выполните шаги, описанные ниже:

## Шаги интеграции:

1. Скачайте и подготовьте: распакуйте файл xcframework.zip, чтобы найти папку Offer18SDK.xcframework.

```
Ссылка для скачивания:
https://web-resources.offer18.net/sdk/ios/build-file/Offer18SDK.xcframework.zip
```

2. Откройте Xcode: откройте проект приложения в Xcode и выберите соответствующий Target проекта.
3. Импортируйте Framework: перейдите на вкладку General и прокрутите до раздела Frameworks, Libraries, and Embedded Content.
4. Добавьте файлы: перетащите папку Offer18SDK.xcframework прямо в этот раздел.
5. Настройте встраивание (обязательно): убедитесь, что параметр "Embed" рядом с framework установлен в Embed & Sign. Примечание: если не выбрать "Embed & Sign", приложение аварийно завершит работу при запуске.

```javascript
let payload: [String: String] = [
    "offerID":123,
    "event": "register",
    "tid": "tid-1234567890",
    "affiliateID": "123",
    "adv_sub1": "advSub1",
    "adv_sub2": "advSub2",
    "adv_sub3": "advSub3",
    "adv_sub4": "advSub4",
    "adv_sub5": "advSub5",
    "adv_sub7": "advSub7",
    "coupon": "coupon_0124",
    "sale": "", // сумма продажи
    "payout": "", // сумма выплаты
    "p_sub_aff_id": "pSubAffId",
    "p_country": "IN",
    "p_timestamp": "17905634563",
    "p_postbackid": "23dds", // уникальный ID postback
    "p_package": "package", // ID пакета
    "status": "1"
]

do {
    Offer18.setDebugLoggingEnabled(true) // отладочный трассировочный вывод

    try Offer18.configure(domain: domain, accountID: accountID)

    try Offer18.trackConversion(data: payload, completion: { result in
        switch result {
        case .success(let response):
            print(response.responseBody)
            self.trackResponse = response.responseBody
            self.statusMessage = response.message
        case .failure(let error):
            self.trackResponse = error.localizedDescription
            self.statusMessage = "Отслеживание не удалось."
            print(error.localizedDescription)
        }
    })
    statusMessage = "SDK успешно настроен."
} catch {
    statusMessage = "Инициализация не удалась: \(error)"
    print(error)
}
```


---

# 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://knowledgebase.offer18.com/ru/set/sdk/ios-sdk.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.
