For the complete documentation index, see llms.txt. This page is also available as Markdown.

Perkox Unity SDK

The official Perkox Offerwall SDK for Unity enables game developers to integrate high-converting, rewarded offerwalls into mobile games for Android and iOS with native performance.

With Perkox, players can earn in-game virtual currency (coins, gems, energy) by completing offers, surveys, and rewarded actions.


Key Features

  • Single Cross-Platform C# API: Clean, static methods for Unity game developers.

  • Native Android & iOS Power: Powered by the official Perkox Android SDK (Kotlin) and iOS SDK (Swift/XCFramework).

  • Unity Editor Simulation (Mock Mode): Test your game loop, UI, and reward distribution directly inside the Unity Editor without crashes or errors.

  • Automated Dependency Resolution: Supports Google External Dependency Manager for Unity (EDM4U) and CocoaPods.

  • Anti-Fraud & Verification: Built-in verification and attribution tracking for maximum publisher revenue protection.


Requirements

Requirement
Supported Version

Unity Editor

Unity 2020.3 LTS or higher

Android

Android 5.0 (API Level 21) or higher

iOS

iOS 12.0 or higher, Xcode 14+

Scripting Backend

Mono or IL2CPP


Installation

  1. In the Unity Editor, navigate to Window > Package Manager.

  2. Click the + icon in the top-left corner and select Add package from git URL...

  3. Enter the public release repository URL:

(Or specify a tag: https://github.com/perkoxofficial/perkox-unity-sdk-releases.git#v2.0.0) 4. Click Add. Unity will automatically download and install the package into your project.

Method 2: .unitypackage Manual Import

  1. Download the latest Perkox-Unity-SDK-v2.0.0.unitypackage from the official GitHub Releases.

  2. Drag and drop the .unitypackage into your Unity project window (or go to Assets > Import Package > Custom Package...).

  3. Ensure all files are checked and click Import.


Quick Start Guide

1. Initialize the SDK

Call PerkoxSDK.Initialize() early in your game lifecycle (for example, in your GameManager's Awake() or Start()):


2. Set Player ID (User Identification)

When a player signs in or their unique account ID becomes known, update the SDK:

Important: The playerId must NOT be empty. Always provide a unique user identifier so rewards and postbacks are accurately attributed to the player.


3. Show the Offerwall

Call PerkoxSDK.ShowOfferwall() when the player taps on an "Earn Rewards" or "Offerwall" button:


Critical: Package ID Matching Requirements

The Perkox backend validates incoming requests against registered App credentials (app_id, sdk_key, and package_id).

Platform
Setting in Unity
Requirement

Android

Player Settings > Identification > Package Name

MUST match the Android Package ID registered in your Perkox Dashboard.

iOS

Player Settings > Identification > Bundle Identifier

MUST match the iOS Bundle Identifier registered in your Perkox Dashboard.

Warning: If the Package Name / Bundle ID does not match the dashboard app entry, the offerwall will return Invalid package_id for this offerwall and show zero offers.


Platform Specific Setup

Android Setup

  • Minimum API Level: 21 (Android 5.0 Lollipop).

  • Target API Level: Android 14 (API Level 34) or latest Google Play requirement.

  • If using EDM4U (External Dependency Manager for Unity), resolve dependencies via Assets > External Dependency Manager > Android Resolver > Resolve.

iOS Setup

  • Target SDK: iOS 12.0 or higher.

  • Post-build script (PerkoxPostProcessBuild.cs) automatically configures the Xcode project with Swift 5.0 and -ObjC linker flags.

  • Run pod install in the generated Xcode project directory if using CocoaPods.


Unity Editor Simulation (Mock Mode)

When testing inside the Unity Editor (Play Mode):

  1. PerkoxSDK.Initialize() safely logs initialization parameters to the Unity Console.

  2. Calling PerkoxSDK.ShowOfferwall() triggers simulated callbacks:

    • Fires OnOfferwallOpened

    • Dispatches a test OnRewardReceived callback (100 Coins)

    • Fires OnOfferwallClosed

  3. Allows complete game loop verification without building native Android or iOS binaries.


For secure reward validation, configure a server-side postback URL in your Perkox Dashboard. When a player finishes an offer, Perkox sends a secure server-to-server callback:

Verify the postback signature with your secret key before crediting virtual currency to player balances.


Support

Need help with integration?

Last updated