> 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/network/sdk/ios-sdk.md).

# iOS SDK

To implement the Direct Manual Import method for the Offer18 iOS SDK, please follow the steps outlined below:

## Integration Steps:

1. Download and Prepare: Unzip the xcframework.zip file to locate the Offer18SDK.xcframework folder.

```
Download Link:
https://web-resources.offer18.net/sdk/ios/build-file/Offer18SDK.xcframework.zip
```

2. Access Xcode: Open the application project in Xcode and select the appropriate Project Target.
3. Import Framework: Navigate to the General tab and scroll to the Frameworks, Libraries, and Embedded Content section.
4. Add Files: Drag and drop the Offer18SDK.xcframework folder directly into this section.
5. Configure Embedding (Required): You must ensure the "Embed" option next to the framework is set to Embed & Sign. Note: Failure to select "Embed & Sign" will cause the application to crash upon launch.

```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": "", //sale amount
    "payout": "", //payout amount
    "p_sub_aff_id": "pSubAffId",
    "p_country": "IN",
    "p_timestamp": "17905634563",
    "p_postbackid": "23dds", //unique postback ID
    "p_package": "package", //package ID
    "status": "1"
]

do {
    Offer18.setDebugLoggingEnabled(true) // debug trace

    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 = "Tracking failed."
            print(error.localizedDescription)
        }
    })
    statusMessage = "SDK configured successfully."
} catch {
    statusMessage = "Initialization failed: \(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/network/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.
