Install SDK

1. Introduction

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

2. Prerequisites

3. SDK Integration

https://www.npmjs.com/package/mychips-react-sdk

3.1 Adding the SDK

npm install mychips-react-sdk
yarn add mychips-react-sdk

3.2 Adding the SDK Dependency to App-Level

Be sure to add this dependencies via yarn or npm

  "dependencies": {
    "@react-native-async-storage/async-storage": "^1.23.1",
    "@react-native-community/netinfo": "^11.3.2",
    "react-native-webview": "^13.10.3"
  }

3.3 Configuring the Android Manifest

In your AndroidManifest.xml, add the following:

Add Permission for Internet Access:

<uses-permission android:name="android.permission.INTERNET" />

4. Initializing the SDK

In your main activity’s onCreate method, import and initialize the SDK:

import { MCOfferwallSDK,MCOfferwallView} from 'mychips-react-sdk';
export default function App() {
  MCOfferwallSDK.init("your api key");
}

Obtain your API key and User ID from Universal Developer Portal

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

  MCOfferwallSDK.setUserId("HERE YOUR USER ID");

4.2 (Optional) Set Google AdvertisingId

Improve the reward tracking by passing the advertinsing id. Official documentation

  MCOfferwallSDK.SetAdvertisingId("HERE YOUR Google Advertising ID");

5. Display the Offerwall

Replace ‘AD_UNIT_ID’ with your actual Ad unit ID.

Create a new page and navigate to it

const ADUNITID="{ADUNIT ID HERE}";

return (
    <View style={styles.container}>
      <View style={styles.webviewContainer}>
        <MCOfferwallView adunitId={ADUNITID}/>
      </View>
    </View>
  );

Style

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  webviewContainer: {
    flex: 1,
    width: '100%',
  },
});

Your Ad unit ID can be found at link

Last updated