Documentation

Here you will find all the info you need to integrate the various monetization tools OfferToro has to offer.

Unity SDK

SDK version 1.2
Updated: Feb 23, 2017

3. OfferWall

  • Step 1. Initialize the OfferWall

    In order to initialize OfferWall, the following parameters should be passed in initialization call: APP_ID, SECRET_KEY and USER_ID.

    The call should look similar to:

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

    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.
  • Step 2. Create OfferToro SDK instance

    OfferToro SDK instances should be created in your MonoBehaviour class in Start() method by calling the following method:

    DelegateController.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:

    SDKInit.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 (@param type string - errorMessage) describing the reason for fail;

    Action OpenOWAction - invoked when OfferWall is displayed;

    Action CreditedOWAction - automatically invoked every several minutes and receives user's balance (first @param type float - totalCredits) and the amount of credits the user has earned (second @param type float- credits) since the last update. The action could also be updated on demand at any point of time by calling GetOfferWallCredits() 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;
       DelegateController.Instance.Create();
    }
    
    void Destroy(){
      DelegateController.Instance.InitSuccessOWAction -= OnOWInitSuccess;
    }

    Where 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.GetOfferWallCredits() 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. The action fires an event automatically every several minutes.

    The action could also be updated on demand by calling SDKInit.Instance.GetOfferWallCredits() method.

    Server-to-Server postback

    Server to Server postbacks is a more secured way to receive notifications, in order to rewarded your users.
    To receive Server to Server postbacks, you must define your postback URL in your App Placement under your OfferToro account
    For more information - Please check this page.