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.
2. 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:
import MyChipsSdk3. Initializating the SDK
Before using the sdk or showing the offerwall you must initialize it:
//replace "YOUR_API_KEY"
MCOfferwallSDK.shared.configure(apiKey: apiKey, userId: userId)Obtain your API key from Universal Developer Portal
3.1 (Mandatory) Set Identifier for Advertisers
Improve reward tracking and eCPM performance by passing the IDFA.
MCOfferwallSDK.shared.setIdfa(idfa: "YOUR_IDFA")3.2 (Optional) Set userId if you have your own unique 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.
3.3 (Optional) Set User Age
You can set the user’s age to help improve ad targeting and analytics.
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).
3.4 (Optional) Set User Gender
You can set the user’s gender to help improve ad targeting and analytics.
Available enum values:
3.5 (Optional) Set custom parameters (aff_sub1–aff_sub5 )
aff_sub1–aff_sub5 )We provide 5
aff_subparameters (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.
4. Displaying the Offerwall
To display the offerwall we provide you with a UIViewController which you can integrate into UIKit or SwiftUI project.
To show the offerwall you need to provide your AdUnitId and a closure which closes the offerwall.
For SwiftUI first we need to wrap the UIViewController:
Now we use the wrapper in our view. Since in this example we will use it in a NavigationView we hide the default back button since the offerwall provides its own:
Now we can add this page to our NavigationView and show the offerwall on a button press:
Your Ad unit ID can be found here
Last updated