React Native
Offerwalls are in-app ads that incentivize users to take particular actions. In return, the user gets an in-app reward and the developer gets paid by the advertiser.
Before you start
To set up the PubScale Offerwall, you’ll need to add your app to our platform. Follow this guide for instructions on how to set up your app. Once completed, you will receive a unique 8-digit app ID.
1. Add this to your build.gradle file
Add the below line inside the dependencies block in your build.gradle file
2. Configure proguard rules
For the SDK to work properly in release(obfuscated/minified) builds, add the following rules in your proguard-rules.pro file.
We have added the SDK to the project. Learn how to initialize the SDK in the next step
3. Add native module files
Add the following files to your android app's module directory.
3.1. Link the module
Add the following line inside the getPackages() method of MainApplication class.
packages.add(new PubscaleOfferwallSdkPackage());
4. Initialize the SDK
To initialize the SDK, call the PubscaleOfferwall.init() method.
Pass the app_id (generated from the console) as the first parameter of the init method. Make sure to call the init method as soon as your app starts up, ideally in app.js or index.js.
Obtain your app_id from the PubScale Dashboard by adding your app and configuring the offerwall. Once completed, you will receive a unique 8-digit app ID.
Optional Parameters:
user_id
Pass your user's id in this field to tag your user. This id will be sent along with the S2S callback. Make sure to call the init function every time the user id changes.
background_Base64
An image that will be displayed as a banner on top of the offer wall. Pass the image in base64 encoded format. The background will be black by default.
appicon_Base64
An image that will be displayed in the center on the top banner of the offerwall. Pass the image in base64 encoded format. Default value is the app icon.
4.1. Making the Init call
Use sandbox environment app ID for testing purposes.
Sandbox Environment - Learn how to setup Sandbox environment
5. Start the OfferWall
To start the offerwall, just call, PubscaleOfferwall.launch()
method.
6. Setup S2S callbacks
Setup the S2S callbacks to get instant updates whenever the user gets the reward. You can use this callback to reward the user in your application. Learn more.
7. Test the OfferWall
Please use the sandbox environment for testing purposes to get instant callbacks and rewards. To learn how to enable the Sandbox environment, click here.
Finally, To test the offerwall, build the application to an actual device. Check if you can launch the Offerwall and get the appropriate callbacks.
Last updated
Was this helpful?