> 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/es/red/sdk/sdk-de-ios.md).

# SDK de iOS

Para implementar el método de Importación Manual Directa para el SDK iOS de Offer18, siga los pasos descritos a continuación:

## Pasos de integración:

1. Descargar y preparar: Descomprima el archivo xcframework.zip para localizar la carpeta Offer18SDK.xcframework.

```
Enlace de descarga:
https://web-resources.offer18.net/sdk/ios/build-file/Offer18SDK.xcframework.zip
```

2. Acceder a Xcode: Abra el proyecto de la aplicación en Xcode y seleccione el Target del proyecto adecuado.
3. Importar framework: Vaya a la pestaña General y desplácese hasta la sección Frameworks, Libraries, and Embedded Content.
4. Agregar archivos: Arrastre y suelte la carpeta Offer18SDK.xcframework directamente en esta sección.
5. Configurar la incrustación (obligatorio): Debe asegurarse de que la opción "Embed" junto al framework esté establecida en Embed & Sign. Nota: No seleccionar "Embed & Sign" provocará que la aplicación se bloquee al iniciarse.

```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) // traza de depuración

    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 = "El seguimiento falló."
            print(error.localizedDescription)
        }
    })
    statusMessage = "SDK configurado correctamente."
} catch {
    statusMessage = "La inicialización falló: \(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/es/red/sdk/sdk-de-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.
