Register

In order for us to know how we can best assist you, please select the best option that describes you

I have encountered a problem or didn't get my credit

I want to promote a product, website or app

I want to monetize my app or website

Instant manager

Remaining: 255 Maximum of 255 characters.

Terms and Conditions

Yes! You’re with us!

Thank you for choosing OfferToro! We will contact you shortly!

Already have an account? Log in

Password reset

Please enter your email address below

< Back to login

Unity SDK

1. Introduction

The OfferToro Unity SDK gives Unity developers an easy way to integrate OfferToro OfferWall module into their native Unity apps.

The OfferToro Unity SDK can be downloaded from your publisher account under SDK section.

Currently, only an Android version is available

Before you can integrate our SDK into your project, you must first create a publisher account and then create an app placement.

Please make sure the monetization tool of the app you are using matches the required monetization tool of the integration. An integration with wrong monetization tool might not work.

2. Getting Started

The OfferToro SDK requires Unity 5th version as a minimum.
To integrate the SDK into your project, please follow the simple steps described below:

Step 1. Add the OfferToro SDK to your project

OTSDKPackage.unitypackage file should be added to your project (and should be automatically unpacked by Unity).

Step 2. Add OfferToro Prefab to your Scene

You should add Prefab OTSDK into your Scene. The Prefab is located under Assests -> OfferToroSDK -> Resources

Step 3. Add write permission

You should add write permission under Player Settings. Don't worry! We will ask the user for writing permisson using a dialog box presented only before usage and as a part of user claming missing credit process.

3. OfferWall

The OfferToro SDK requires Unity 5th version as a minimum.
To integrate the SDK into your project, please follow the simple steps described below:

Step 1. Add the OfferToro SDK to your project

OTSDKPackage.unitypackage file should be added to your project (and should be automatically unpacked by Unity).

public static string YOUR_OW_APP_ID = ""; //set your value
public static string YOUR_OW_SECRET_KEY = ""; //set your value
public static string YOUR_OW_USER_ID = ""; //set your value

OTOfferWallSettings.Instance.configInit(YOUR_OW_APP_ID, YOUR_OW_SECRET_KEY, YOUR_OW_USER_ID);
//optional
OTOfferWallSettings.Instance.configSubids(SUBID1, SUBID2, SUBID3);

Note:

- APP_ID and SECRET_KEY can be found in your OfferToro account, under your "App Placement" settings.
- USER_ID is a parameter which should be passed from your end as a unique ID for each end user of your app.
- configSubids is optional and you can add up to 3 subids
Step 2. Create OfferToro SDK instance
OfferToro SDK instances should be created by calling the following method:

OTSDK.Instance.Create();

Step 3. Display the OfferWall
After being successfully initialized, the OfferWall could be displayed into the app. For displaying the OfferWall ShowOfferWall() method should be called:

OTSDK.Instance.ShowOfferWall();

Step 4. Subscribe to OfferWall actions
The OfferToro SDK gives a possibility to be notified of events happening in OfferWall lifecycle via OfferWall actions.

The following actions are available in DelegateController:

Action InitSuccessOWAction - invoked when OfferWall is successfully initialized;

Action InitFailOWAction - invoked when OfferWall initialization fails and receives an error message (@param type string - errorMessage) describing the reason for failure;

Action OpenOWAction - invoked when OfferWall is displayed;

Action CreditedOWAction - receive user's balance (first @param type float - totalCredits) and the amount of credits the user has earned (second @param type float- credits). The action can be updated on demand at any point of time by calling GetUserCredits(); method.

Action CloseOWAction - invoked when OfferWall is closed.

To be notified of OfferWall events, you need to subscribe to actions in Start() method of your MonoBehaviour class and then unsubscribe in Destroy() method of your MonoBehaviour class.

For example:

void Start() {
    OTOfferWallSettings.Instance.configInit(YOUR_OW_APP_ID,
        YOUR_OW_SECRET_KEY, YOUR_OW_USER_ID);
    DelegateController.Instance.InitSuccessOWAction += OnOWInitSuccess;
}

void Destroy(){
    DelegateController.Instance.InitSuccessOWAction -= OnOWInitSuccess;
}

TWhere OnOWInitSuccess() is the method that you intend to subscribe to InitSuccessOWAction action.

The OfferToro SDK gives possibility to receive an event via Action CreditedOWAction in OfferWall lifecycle at any point of time by calling SDKInit.Instance.GetUserCredits() method.

Step 5. Reward your users
The OfferToro SDK supports two ways to reward your users. Those are:

1. Client-side postback
2. Server-to-Server postback
Client-side postback

User’s balance and the amount of credits the user has recently earned are available via Action CreditedOWAction action. This action should be fired after method SDKInit.Instance.GetUserCredits() is called.

Calling SDKInit.Instance.GetUserCredits() method every several minutes is recommended .

Server-to-Server postback

Server to Server postbacks is a more secure way to receive notifications, in order to reward your users.
To receive Server to Server postbacks, you must define your postback URL in your App Placement under your OfferToro account