# Install SDK

## 1. Introduction

This guide provides a comprehensive walkthrough for integrating the MyChips SDK into your iOS application, enabling the display of an engaging offerwall.

Once installed, you can choose between two integration options:

* **Offerwall** — A full-screen WebView experience managed by the SDK. See [Offerwall Integration →](/ios/sdk-offerwall.md)
* **Native Campaigns** — A customizable campaign list that you embed directly in your app's UI. See [Native Integration →](/ios/sdk-native.md)

Both options use the same SDK. Install it once, then pick the integration that fits your app.

## 2. Prerequisites

* Xcode 16 or later
* Minimum deployment target **iOS 14**.

## 3. SDK Integration

In your project in Xcode go to **File -> Add Package Dependencies...** and then add the dependency using the following repo: <https://github.com/myappfree/mychips-ios-sdk>

Now in your project you can import the SDK:

```swift
import MyChipsSdk
```

## 4. Initializating the SDK

Before using the sdk or showing the offerwall you must initialize it:

```swift
//replace "YOUR_API_KEY"
MCOfferwallSDK.shared.configure(apiKey: "YOUR_API_KEY")
```

> Obtain your API key  from [Universal Developer Portal](https://dashboard.maf.ad)

#### 4.1 (Mandatory) Set Identifier for Advertisers

Improve reward tracking and eCPM performance by passing the IDFA.&#x20;

```swift
MCOfferwallSDK.shared.setIdfa(idfa: "YOUR_IDFA")
```

#### 4.2 (Optional) Set userId if you have your own unique id

```swift
MCOfferwallSDK.shared.setUserId(userId: "YOUR_USER_ID")
```

> Replace `"`YOUR\_USER\_ID`"` with your actual user ID variable or value.
>
> If you do not provide a specific user ID, one will be automatically generated.

#### 4.3 (Optional) Set User Age

You can set the user’s age to help improve ad targeting and analytics.

```swift
  MCOfferwallSDK.shared.setAge(30)
```

Replace 30 with your actual user age variable or value (integer).

💡 **Note:**

* The value should be an integer (e.g., 18, 25, 30).
* Expected range is 0–100 (inclusive).

#### 4.4 (Optional) Set User Gender

You can set the user’s gender to help improve ad targeting and analytics.

```swift
  MCOfferwallSDK.shared.setGender(.female)
```

Available enum values:

```swift
 .male
 .female
 .other
```

#### 4.5  (Optional) Set custom parameters (`aff_sub1`–`aff_sub5` )

```swift
MCOfferwallSDK.shared.setAffSub1("YOUR_CUSTOM_VALUE")
MCOfferwallSDK.shared.setAffSub2("YOUR_CUSTOM_VALUE")
MCOfferwallSDK.shared.setAffSub3("YOUR_CUSTOM_VALUE")
MCOfferwallSDK.shared.setAffSub4("YOUR_CUSTOM_VALUE")
MCOfferwallSDK.shared.setAffSub5("YOUR_CUSTOM_VALUE")
```

> We provide 5 `aff_sub` parameters (`aff_sub1`, `aff_sub2`, `aff_sub3`, `aff_sub4`, `aff_sub5`), which you can use to pass custom values.
>
> Replace `"`YOUR\_CUSTOM\_VALUE`"` with your actual custom value.

### **5. Next Steps**

Choose your integration:

<table><thead><tr><th width="174">Integration</th><th width="317">Description</th><th>Guide</th></tr></thead><tbody><tr><td><strong>Offerwall</strong></td><td>Full-screen WebView experience</td><td><a href="/pages/5fu0t3aeysUOsDFBIvQI">Offerwall Integration →</a></td></tr><tr><td><strong>Native Campaigns</strong></td><td>Customizable campaign list in your UI</td><td><a href="/pages/Dh0pHdE9elZzizZIOsGc">Native Quick Start →</a></td></tr></tbody></table>


---

# 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://docs.mychips.io/ios/install-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.
