Offerwall SDK
Dashboard
1.0.7
1.0.7
  • 👋Welcome to PubScale Offerwall SDK
  • Prerequisites
    • 📪Prerequisites
    • 🧙PubScale Onboarding
  • Native Android
    • ⬇️Setting up the SDK
    • 🔌Initialize the SDK
    • 🎬Start the OfferWall
  • React Native
    • ⬇️Setting up the SDK
    • 🔌Initialize the SDK
    • 🎬Start the OfferWall
  • Flutter
    • ⬇️Adding the dependencies
    • 🔌Launch the offerwall
  • Unity
    • ✅Preintegration Checks
    • ⬇️Setting up the SDK
    • 🔌Integration
  • Web (Beta)
    • ⬇️IFrame integration
    • ⬇️Direct Link
  • S2S Callback Configuration
    • 🦉S2S Callback Configuration
    • 🗝️IP Whitelist
  • Sandbox Environment
    • 🩺Sandbox Environment
  • 🔮Samples
Powered by GitBook
On this page
  • Creating OfferWallConfig object:
  • Initialize the Offerwall SDK:
  1. Native Android

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.

Use sandbox environment app ID for testing purposes.

Sandbox Environment - Learn how to setup Sandbox environment

import com.pubscale.sdkone.offerwall.OfferWallConfig
..
..
val offerWallConfig = OfferWallConfig.Builder(context, "YOUR_PUBSCALE_APP_ID")
   .setUniqueId("unique_id") //optional, used to represent the user of your application
   .setLoaderBackgroundBitmap(backgroundBitmap) //optional
   .setLoaderForegroundBitmap(foreground) //optional
   .setFullscreenEnabled(false) //optional
   .build()
import com.pubscale.sdkone.offerwall.OfferWallConfig
..
..
OfferWallConfig offerWallConfig =
       new OfferWallConfig.Builder(context, "YOUR_PUBSCALE_APP_ID")
               .setUniqueId("unique_id") //optional, used to represent the user of your application
               .setLoaderBackgroundBitmap(backgroundBitmap)//optional
               .setLoaderForegroundBitmap(foregroundBitmap)//optional
               .setFullscreenEnabled(false)//optional
               .build();

These are the public methods available for OfferWallConfig.Builder class:

Public Methods
Description

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.

OfferWall.init(offerWallConfig, object : OfferWallInitListener {
   override fun onInitSuccess() {
   }
   override fun onInitFailed(error: InitError) {
   }
})
OfferWall.init(offerWallConfig, new OfferWallInitListener() {
   @Override
   public void onInitSuccess() {

   }

   @Override
   public void onInitFailed(@NonNull InitError error) {

   }
});

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()

PreviousSetting up the SDKNextStart the OfferWall

Last updated 1 year ago

🔌