Initialize the SDK
You must initialize the SDK before using the SDK. To do this, call Offerwall.init(OfferWallConfig, OfferWallInitListener)
.
Parameters for init call:
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.
Creating OfferWallConfig object:
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.
setFullscreenEnabled(Boolean isEnabled)
Sets if the offerwall should open in fullscreen mode or not. Default: false
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
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:
Initialize the OfferWall SDK by calling the init function by passing the offer wall config.
OfferWallInitListener is an optional parameter in init() method.
If you need to change any config after initializing the SDK, you should destroy and re-init the SDK.
To destroy, call OfferWall.destroy()
Last updated