Offerwall SDK
1.0.10
1.0.10
  • 👋Welcome to PubScale Offerwall SDK
  • Basic Integration
    • Setting up your app
    • Android Integration
    • React Native
    • Unity
    • Web
    • iOS
  • 🦉Server-to-Server (S2S) Callback Configuration
  • Sandbox Environment
    • 🩺Sandbox Environment
  • 🔮Samples
  • FAQs
Powered by GitBook
On this page
  • 1. Add this to your build.gradle file
  • 2. Configure proguard rules
  • 3. Initializing the OfferWall
  • 3.1. Parameters for init call:
  • 3.2. Creating OfferWallConfig object:
  • 3.3. Making the init call:
  • 4. Start the OfferWall
  • 5. Setup S2S callbacks
  • 6. Test the OfferWall

Was this helpful?

  1. Basic Integration

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.

PreviousSetting up your appNextReact Native

Last updated 4 days ago

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.

You can download the Sample integration from

1. Add this to your build.gradle file

Add the below line inside the dependencies block in your build.gradle file. Once added, clean build and rebuild the project.

implementation("com.pubscale.sdkone:offerwall:1.0.10")
implementation 'com.pubscale.sdkone:offerwall:1.0.10'

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.

proguard-rules.pro

-keep class com.pubscale.sdkone.offerwall.** {*;}
-keep class com.pubscale.caterpillar.analytics.** {*;}
#Supporting R8 full mode
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response

3. Initializing the OfferWall

You must initialize the SDK before using the SDK. To do this, call Offerwall.init(OfferWallConfig, OfferWallInitListener) .

3.1. 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.

3.2. 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")
   .build()
import com.pubscale.sdkone.offerwall.OfferWallConfig
..
..
OfferWallConfig offerWallConfig =
       new OfferWallConfig.Builder(context, "YOUR_PUBSCALE_APP_ID")
               .setUniqueId("unique_id")
               .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.

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.

3.3. Making the init call:

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

   }
});

Make sure to handle Offerwall init failures properly as the init might fail in scenarios where the PubScale system detects a fraudulent environment.

If you need to change any config after initializing the SDK, you should destroy and re-init the SDK.

To destroy, call OfferWall.destroy()

4. Start the OfferWall

To start the offerwall, just call, OfferWall.launch(Context, OfferWallListener);

A listener can be set to listen for events fired by the Offer Wall.

import com.pubscale.sdkone.offerwall.OfferWall
import com.pubscale.sdkone.offerwall.models.OfferWallListener
import com.pubscale.sdkone.offerwall.models.Reward
..
..
..
val offerWallListener = object : OfferWallListener{

   override fun onOfferWallShowed() {
       Log.d("PSOfferwall", "Offer wall showed.")
   }

   override fun onOfferWallClosed() {
       Log.d("PSOfferwall", "Offer wall closed.")
   }

   override fun onRewardClaimed(reward: Reward) {
       Log.d("PSOfferwall", "Offer wall reward claimed.")
   }

   override fun onFailed(message: String) {
       Log.d("PSOfferwall", "onFailed: $message")
   }
}                 
import com.pubscale.sdkone.offerwall.OfferWall
import com.pubscale.sdkone.offerwall.models.OfferWallListener
import com.pubscale.sdkone.offerwall.models.Reward
..
..
OfferWallListener offerWallListener = new OfferWallListener() {

   @Override
   public void onOfferWallShowed() {
       Log.d("PSOfferwall", "Offer wall showed.");
   }

   @Override
   public void onOfferWallClosed() {
       Log.d("PSOfferwall", "Offer wall closed.");
   }

   @Override
   public void onRewardClaimed(@NonNull Reward reward) {
       Log.d("PSOfferwall", "Offer wall reward claimed.");
   }

   @Override
   public void onFailed(@NonNull String message) {
       Log.d("PSOfferwall", "onFailed: " + message);
   }
};

onRewardClaimed callback gives you the reward amount and currency details.

To start the OfferWall, call the launch method of the OfferWall class.

import com.pubscale.sdkone.offerwall.OfferWall
import com.pubscale.sdkone.offerwall.models.OfferWallListener
..
..
OfferWall.launch(context, offerWallListener)            
import com.pubscale.sdkone.offerwall.OfferWall
import com.pubscale.sdkone.offerwall.models.OfferWallListener
..
..
OfferWall.launch(context, offerWallListener);

5. Setup S2S callbacks

6. Test the OfferWall

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, .

PubScale Dashboard
adding your app and configuring the offerwall.
Learn more.
click here
how to set up your app
GitHub
Offerwall Android SDK integration video tutorial