iOS Rewarded Video Integration

Integrate Rewarded Video

Launching a rewarded video requires at least three parameters or data points: your publisher ID, the profile ID associated with a Rewarded Video profile that you have created, and the unique ID of the user who will be watching the rewarded video. You can get your profile ID and publisher ID after setting up your Rewarded Video profile.


Showing the Rewarded Video

Before proceeding make sure you have integrated the SDK in your project.

To display a rewarded video, initialize a new rewarded video view controller with the values you gathered above for Publisher ID and Profile ID, along with the end user's unique ID for subId1 in the following way

static NSString* const publisher_Id = @"32740";
static NSString* const profile_Id = @"365";
static NSString* const subId_1 = @"demo_subid1";

[ADRewardedVideoViewController newRewardedVideoForPublisherId:publisher_Id profileId: profile_Id subId1:subId_1 delegate:self success:^(ADRewardedVideoViewController *rewardVC) {
      // The response may take some time due to network activity. So you need to show activity indicator yourself till you wait for response.
      //On success present the returned rewardedVideoVC using SDK presentFrom: method.
      [rewardedVideoVC presentFrom:self failure:^(NSString *errorMsg) {
        //If presenting the rewardedVideoVC fails, you get the error here.
          NSLog(@"%@", errorMsg);
      }];

  } failure:^(NSString *errorMessage){

      //Error in getting any video data. Handle the error here.
      NSLog(@"Did not receive any video data.");
  }];

Detecting Video Completion

In addition to the postback we make when the video is watched, the following example will show how to detect the end of the video play so you can then visually credit the user in your application, show a message or complete any other action that you may want to when the video is completed.

The presenting view controller must conform to ADRewardedVideoViewControllerDelegate to receive callbacks:

-(void)onCloseVideoVCPressed
{

}

-(void)onUserCredited
{

}

-(void)onUserNotCredited
{

}

You will also find a sample XCode project in the downloaded SDK showing how to integrate our Rewarded Video.

Rate Limiting Users

To limit a user's ability to watch rewarded videos to a certain number of times, it is best to maintain an external counter and hide the call-to-action after the user has initiated the action a certain number of times.

Need Help With Your Integration?

If you have any questions about integrating our Rewarded Video into your project, shoot us an email at
SDKsupport@adscendmedia.com