Unity
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.
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 how to set up your app. Once completed, you will receive a unique 8-digit app ID.
✅ Preintegration checks
Make sure you are using Unity version 2019.4.0f1 or above
Ensure your application builds without any errors before adding the plugin.
Android platform is selected for your Unity project.
The Editor must support Android Gradle version 4.0.1 or above.
1. Add the OfferWall Unity plugin to your Unity project
Download and import the latest version of OfferWall Unity Plugin from GitHub.
2. Configuring Publishing Settings
Set the minimum API level to 24 or above and the target API level to 33 or above under Edit/ProjectSettings/Player/Other Settings
Make sure you check the below-mentioned checkboxes under Edit/ProjectSettings/Player/Publishing Settings.
Custom Main Manifest
Custom Main Gradle Template
Custom Gradle Settings Template
3. Configuring dependencies
Adding mavenCentral()
as a repository in settingsTemplate.gradle
Add the below line inside the dependencies block in your mainTemplate.gradle file
4. Force resolve dependencies
Force resolve forces the Package Manager to resolve the project’s packages, reinstalling any altered or missing package and removing extraneous packages.
To Force resolve the dependencies, Goto Assets > External Dependency Manager > Android Resolver > Force Resolve (if the resolver did not open automatically)
OfferWall does not work in the Editor. Please use a real device to test the integration.
5. Configuring Prefabs
Drag and Drop PubScaleOfferwallObject prefab
Drag and drop the PubScaleOfferwallObject prefab from Assets/OfferWall/Prefab/PubScaleOfferwallObject.prefab in the scene.
6. Configuring App Key
Enter your PubScale app ID inside the "Pubscale App ID" field located on the PubScaleOfferwallObject.
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, click here.
7. Initialize the SDK
To launch the OfferWall, call the PubScaleOfferwallClient.Initialize(string userId) function using the instance from PubScaleOfferwallObject prefab.
Expected params:
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.
8. 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
9. 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.
10. Handling the SDK callbacks (optional)
To handle the SDK callbacks, subscribe to the events that are made available by the SimpleIntegration script.
11. Launch the OfferWall
To launch the OfferWall, call the AdvancedIntegration.ShowOfferWall() function using the PubScaleOfferwallAdvanced prefab.
Can also be used in onClick of a button:
11. Setup S2S callbacks
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. Learn more.
12. Test the OfferWall
Please use the sandbox environment for testing purposes to get instant callbacks and rewards. To learn how to enable the Sandbox environment, click here.
Finally, To test the offerwall, build the application to an actual device. Check if you can launch the Offerwall and get the appropriate callbacks.
Last updated
Was this helpful?