Documentation

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

Unity SDK

SDK version 3
Updated: Oct 14, 2020

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

    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 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 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;
    }
    
    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. This action should be fired after method SDKInit.Instance.GetOfferWallCredits() is called.

    Calling SDKInit.Instance.GetOfferWallCredits() 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
    For more information - Please check this page.