Android Integration
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.
Last updated
Was this helpful?
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.
Last updated
Was this helpful?
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 . Once completed, you will receive a unique 8-digit app ID.
Add the below line inside the dependencies block in your build.gradle file. Once added, clean build and rebuild the project.
For the SDK to work properly in release(obfuscated/minified) builds, add the following rules in your proguard-rules.pro file.
You must initialize the SDK before using the SDK. To do this, call Offerwall.init(OfferWallConfig, OfferWallInitListener)
.
OfferWallConfig offerWallConfig: An object to pass configuration-related info to the SDK while initializing. Refer below for how to create an object of OfferWallConfig.
OfferWallInitListener offerWallInitListener: A listener that informs you if the SDK initialization was successful or not. In case of failure, it will also give you a string stating the cause of the failure. This parameter is optional.
Create an instance of OfferWallConfig using the builder class OfferWallConfig.Builder by passing the context and your PubScale app ID.
These are the public methods available for OfferWallConfig.Builder class:
setUniqueId(String uniqueId)
Sets a unique id that will be used to identify the user uniquely. This will be sent back in the postback.
setLoaderBackgroundBitmap(Bitmap bitmap)
Accepts a bitmap and uses it as the background image for the loader and offerwall top banner. Default: Black color image
setLoaderForegroundBitmap(Bitmap bitmap)
Accepts a bitmap and uses it as the foreground image for the loader and offerwall top banner. Default: App icon
setFullscreenEnabled(Boolean isEnabled)
Sets if the offerwall should open in fullscreen mode or not. This can be used in apps or games where an immersive experience is needed. Default: false
build()
Builds the config and returns OfferWallConfig instance
If a unique ID is not set, rewarding the user is not guaranteed.
Initialize the OfferWall SDK by calling the init function by passing the offer wall config.
To start the offerwall, just call, OfferWall.launch(Context, OfferWallListener);
A listener can be set to listen for events fired by the Offer Wall.
To start the OfferWall, call the launch method of the OfferWall class.
Finally, To test the offerwall, build the application to an actual device. Check if you can launch the Offerwall and get the appropriate callbacks.
Obtain your PubScale app ID from the by Once completed, you will receive a unique 8-digit app ID.
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.
Please use the sandbox environment for testing purposes to get instant callbacks and rewards. To learn how to enable the Sandbox environment, .