SDK - Offerwall
Offerwall Integration
Prerequisite: Complete SDK Installation first.
The Offerwall displays available campaigns inside a React Native screen. Initialize the SDK, then mount MCOfferwallView with your Offerwall ad unit ID.
1. Configure the screen
Install react-native-webview as described in SDK Installation. The React Native Offerwall uses the app's WebView dependency; you do not register the Android MCOfferwallActivity used by the separate Android native SDK.
Give the Offerwall a container with enough space to fill your screen or the area where it should appear.
2. Display the Offerwall
import React from 'react';
import {StyleSheet, View} from 'react-native';
import {MCOfferwallView} from 'mychips-react-sdk';
export function OfferwallScreen() {
return (
<View style={styles.container}>
<MCOfferwallView adunitId="YOUR_OFFERWALL_AD_UNIT_ID" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
width: '100%',
},
});Replace YOUR_OFFERWALL_AD_UNIT_ID with the Offerwall ad unit ID from the Developer Portal. Make sure MCOfferwallSDK.init('YOUR_API_KEY') has run before this screen is shown.
3. (Optional) Set user information
If your app has a stable user ID, set it before displaying the Offerwall:
For device identifiers, age, gender, and custom aff_sub parameters, see Initialize the SDK.
Native Campaigns:
MCOfferwallViewreceives its ad unit ID through theadunitIdprop.MCNativeAdViewusesawait MCOfferwallSDK.setAdunitId('YOUR_NATIVE_AD_UNIT_ID')instead. See Native Quick Start →
Last updated