Documentation

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

iOS SDK

SDK version 3.5
Updated: Sep 25, 2017

4. Rewarded Video

  • Step 1. Implement your delegate

    The OfferToro SDK gives a possibility to be notified of events happening in Rewarded Video module lifecycle via delegate OfferToroDelegate.

    Objective-C:

    [OfferToro sharedInstance].delegate = YOUR_DELEGATE

    Swift:

    OfferToro.sharedInstance()?.delegate = YOUR_DELEGATE

    Your delegate will be notified of all possible events listed below:

    - (void)offertoroRWInitSuccess;

    // Invoked when Rewarded Video is successfully initialized

    - (void)offertoroRWInitFail:(NSError *)error;

    // Invoked when Rewarded Video initialization fails

    - (void)offertoroRWStart;

    // Invoked when Rewarded Video screen is presented

    - (void)offertoroRWAvailability:(BOOL)isAvailable;

    // Automatically invoked every several minutes and indicates whether Rewarded Videos are available or not.
    It could also be updated on demand at any time by calling getRVAvailability method (described in Step 4. Reward your users section below).

    - (void)offertoroRWCredited:(NSNumber *)amount;

    // Invoked when Rewarded Video is credited and (amount) receives the amount of credits the user has earned for watching the video.

  • Step 2. Configure the Rewarded Video module

    Rewarded Video module should be initialized on the application launch.

    Objective-C:

    [[OfferToro sharedInstance] initRVWithAppId:APP_ID userId:USER_ID secretKey:SECRET_KEY];

    Swift:

    OfferToro.sharedInstance()?.initRV(withAppId: APP_ID, userId: USER_ID, secretKey: SECRET_KEY)

    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 an ID for each end user of your app. A common practice is to use the Advertising Identifier IDFA.

  • Step 3. Present the Rewarded Video

    To present Rewarded Video presentRVInViewController method should be called:

    Objective-C:

    [[OfferToro sharedInstance] presentRVInViewController:VIEW_CONTROLLER animation:YES];

    Swift:

    OfferToro.sharedInstance()?.presentRV(inViewController: VIEW_CONTROLLER, animation: true)

  • Step 4. Reward your users

    OfferToro SDK supports two ways to reward your users. Those are:

    • 3. Client-side postback
    • 4. Server-to-Server postback

    Client-side postback

    The amount of credits the user has earned for watching the video is provided automatically via offertoroRWCredited delegate (described in Step 1. Implement your delegate section above).

    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: