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
  • 1. Configuring Prefabs
  • 2. Configuring App Key
  • 3. Initialize the SDK
  • 4. Custom loader background image and foreground image
  • 5. Set Offerwall Orientation
  • 6. Handling the SDK callbacks (optional)
  • 7. Launch the OfferWall
  • 8. Test the OfferWall
  1. Unity

Integration

This page will explain the process of integration. Here, you can make use of the already available prefab to reduce the scripting tasks.

PreviousSetting up the SDKNextIFrame integration

Last updated 1 year ago

OfferWall does not work in the Editor. Please use a real device to test the integration.

1. Configuring Prefabs

Drag and Drop PubScaleOfferwallObject prefab

Drag and drop the PubScaleOfferwallObject prefab from Assets/OfferWall/Prefab/PubScaleOfferwallObject.prefab in the scene.

2. Configuring App Key

Enter your PubScale app ID inside the "Pubscale App ID" field located on the PubScaleOfferwallObject.

3. Initialize the SDK

To launch the OfferWall, call the PubScaleOfferwallClient.Initialize(string userId) function using the instance from PubScaleOfferwallObject prefab.

PubScaleOfferwallClient myScriptInstance = GetComponent<PubScaleOfferwallClient>();
// Check if the script instance is not null
if (myScriptInstance != null)
{
    myScriptInstance.InitOfferWall(userId);
}

Expected params:

  1. userID: A string value that is used to identify the user uniquely in your application. If this value is null, the SDK would internally create a userId for the device.

4. Custom loader background image and foreground image

Step 1: Custom loader background and loader foreground

To use custom background and foreground images for the loading screen replace the demo_background_img and demo_foreground_img file located under Assets/OfferWall/Resources with the image you need.

Step 2: Enable Read and Write under Advance Image settings

Press the preset button on your imported image and then select the OfferWallTextureImporter preset from the menu and click apply.

If the fields are left empty, the default values will be used:

  • Background: Black image

  • Foreground: App icon

5. Set Offerwall Orientation

By default, the Offerwall opens in Portrait orientation. If you want to change this behaviour, do the following changes.

Add the below line inside the <application></application> tag in your AndroidManifest.xml file.

<activity android:name="com.pubscale.sdkone.offerwall.ui.OfferWallActivity" android:screenOrientation="landscape" />

6. Handling the SDK callbacks (optional)

To handle the SDK callbacks, subscribe to the events that are made available by the SimpleIntegration script.

//Define functions that would be called when the callbacks are given
void OnSDKInitSuccess() {
    
}

void OnSDKInitFailed(string message) {
    
}

void OnOfferwallShowed() {
    
}

void OnOfferwallClosed() {
    
}

void OnRewardClaimed(Reward reward) {
    
}

void OnOfferwallFailed(string message) {
    
}

//Subscribe to the events
PubScaleOfferwallClient.OnSDKInitSuccess += OnSDKInitSuccess;
PubScaleOfferwallClient.OnSDKInitFailed += OnSDKInitFailed;
PubScaleOfferwallClient.OnOfferwallShowed += OnOfferwallShowed;
PubScaleOfferwallClient.OnOfferwallClosed += OnOfferwallClosed;
PubScaleOfferwallClient.OnRewardClaimed += OnRewardClaimed;
PubScaleOfferwallClient.OnOfferwallFailed += OnOfferwallFailed;

7. Launch the OfferWall

To launch the OfferWall, call the AdvancedIntegration.ShowOfferWall() function using the PubScaleOfferwallAdvanced prefab.

PubScaleOfferwallClient myScriptInstance = GetComponent<PubScaleOfferwallClient>();
// Check if the script instance is not null
if (myScriptInstance != null)
{
    myScriptInstance.ShowOfferWall();
}

Can also be used in onClick of a button:

8. Test the OfferWall

Finally, To test the offer wall, build the application to an actual device. Check if you can launch the Offerwall and get the appropriate callbacks.

The PubScale App ID is an 8-digit identifier generated during the app creation process within the dashboard. If you need help creating an account/app with us, .

Please use the sandbox environment for testing purposes to get instant callbacks and rewards. To learn how to enable the Sandbox environment, .

🔌
click here
click here
Offerwall Prefab
Example usage: Launching Offerwall on click of a button