Rewarded video in Unity

Rewarded is an ad video format that is displayed in a full screen window. After viewing the full ad, the user receives a reward. The reward can be minutes of an application service, delivery of virtual currencies of the game or application, one more try, an extra life, etc.

IMPORTANT: Rewarded video is only available for Android.

Rewarded configuration without Scene Manager

How we have explained Rewarded video ads work by user interaction. This requires more complexity than other types of ad, but the revenue is better. To integrate Rewarded we must put the TappxManagerUnity prefab in the same scene in which we want to show the video. There are three basic things to keep in mind in order to successfully integrate rewarded ads. Load the ad, show it and reward the user for seeing it.

For the first two steps we will use the TappxManagerUnity instance (we remember that it must be in the scene). Similar to other Tappx ads, we have the next similar functions: loadRewarded, isRewardedReady y rewardedShow.

This division of functions is useful and practical in rewarded video. For example, in a game you can load the ad while the user is playing a level and then show it when the level ends or pauses the game. In video ads it is much more relevant than in display since the ad is heavier and may take longer to load. For this reason, the ideal is to use the preload of the ad before it is going to be shown. Also, this will improve the user experience.

TappxManagerUnity.instance.loadRewarded();

loadRewarded load all the necessary information to be able to display the ad.

TappxManagerUnity.instance.isRewardedReady();

isRewardedReady checks that the ad is ready to be shown.
It receives a "true" when it is ready and a "false" when it is not.

TappxManagerUnity.instance.rewardedShow();

rewardedShow displays the previously uploaded video ad.

Note: The Rewarded box in the SceneManager, replaces the “loadRewarded ()” part, however, we recommend doing all the Rewarded steps by code.

Rewarded video example in Unity

Below you can see a small example of running a rewarded video ad.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class start : MonoBehaviour {
    // Start is called before the first frame update

    void Start() {
        TappxManagerUnity.instance.loadRewarded();

    }
    void RewardedLoaded(){

    }

    // Update is called once per frame
    void Update() {
          if(SomeEventTrue){
              if(TappxManagerUnity.instance.isRewardedReady()){
                  TappxManagerUnity.instance.rewardedShow();
              }
          }
     }
}

Rewarded video listeners in Unity

It is very important the use of rewarded video listeners to be able to reward only the users who have watched the videos to the end. The listeners must be edited in the imported file in Tappx/Scripts/TappxManagerUnity.cs.

public void RewardedLoaded(){
    UnityEngine.Debug.Log("Rewarded Load");
}
public void RewardedFailedToLoad(string error){
    UnityEngine.Debug.Log("Rewarded failed to Load " + error);
}
public void RewardedVideoStart(){
    UnityEngine.Debug.Log("Rewarded Start");
}
public void RewardedVideoClicked(){
    UnityEngine.Debug.Log("Rewarded Clicked");
}
public void RewardedVideoPlaybackFailed(){
    UnityEngine.Debug.Log("Rewarded Playback Failed");
}
public void RewardedVideoClosed(){
    UnityEngine.Debug.Log("Rewarded Closed");
}
public void RewardedVideoCompleted(){
    UnityEngine.Debug.Log("Rewarded Complete");
}

Tappx © 2020