Install SDK
1. Introduction
This guide provides a comprehensive walkthrough for integrating the MyChips SDK into your Flutter application, enabling the display of an engaging offerwall.
2. SDK Integration
To add the package to your project folder using the terminal:
$ flutter pub add my_chips_flutter_sdkNow in your main.dart code, you can import it:
import 'package:my_chips_flutter_sdk/my_chips_flutter_sdk.dar3. Initializating the SDK
Before using the sdk or showing the offerwall you must initialize it:
//replace "YOUR_API_KEY"
await MCOfferwallSdk.instance.init("YOUR_API_KEY");Obtain your API key and User ID from Universal Developer Portal
3.1 (Mandatory) – Set Google Advertising ID (Android) and Identifier for Advertisers (iOS)
Improve reward tracking and eCPM performance by passing the Google Advertising ID (Official documentation) for Android devices and the IDFA for iOS devices.
Android:
await MCOfferwallSdk.instance.setGaid("YOUR_GAID");Replace "YOUR_GAID" with your actual Google Advertising ID variable or value.
iOS:
await MCOfferwallSdk.instance.setIdfa("YOUR_IDFA");Replace "YOUR-IDFA" with your actual IDFA variable or value.
3.2 (Optional) Set userId if you have your own unique id
//replace "YOUR_USER_ID"
await MCOfferwallSdk.instance.setUserId("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.
3.3 (Optional) Set User Age
You can set the user’s age to help improve ad targeting and analytics.
await MCOfferwallSdk.instance.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).
3.4 (Optional) Set User Gender
You can set the user’s gender to help improve ad targeting and analytics.
await MCOfferwallSdk.instance.setGender(MCGenderEnum.male);Available enum values:
MCGenderEnum.male
MCGenderEnum.female
MCGenderEnum.other3.5 (Optional) Set Custom Parameters (aff_sub1–aff_sub5 )
aff_sub1–aff_sub5 )We provide 5 aff_sub parameters (aff_sub1, aff_sub2, aff_sub3, aff_sub4, aff_sub5), which you can use to pass custom values.
MCOfferwallSDK.setAffSub1("HERE YOUR CUSTOM VALUE");
MCOfferwallSDK.setAffSub2("HERE YOUR CUSTOM VALUE");
MCOfferwallSDK.setAffSub3("HERE YOUR CUSTOM VALUE");
MCOfferwallSDK.setAffSub4("HERE YOUR CUSTOM VALUE");
MCOfferwallSDK.setAffSub5("HERE YOUR CUSTOM VALUE");Replace "HERE YOUR CUSTOM VALUE" with your actual custom value.
4. Display the Offerwall
To show the offerwall we provide you with a widget called OfferwallPage. You should show it as a page using your preferred navigation package/method.
Example using the default flutter navigator:
//replace "YOUR_AD_UNIT_ID"
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => OfferwallPage(
adunitId: "YOUR_AD_UNIT_ID",
),
),
);Your Ad unit ID can be found at here
Last updated