Implementation of RewardVideo advertisement

Video reward advertisement is an advertisement format that displays video advertisements of about 15 seconds to 30 seconds instead of giving users the items and points available in the application.
In GenieeSDK, mediation function displays RewardVideo advertisement of each ad network.

Preparation for implementation

For RewardVideo Advertisement, the following implementation preparation is necessary.

  • Geniee SDK

    From the start guide below, you need to install Geniee SDK (GNAdSDK) in the application. Startup

  • Each Ad Network SDK and adapter

    For video rewarding, it is necessary to set the SDK for each ad network and the adapter (GNSRewardAdapter).
    To set all the ad networks collectively, please refer to the following link introduction method.
    Bulk Implementation of All Ad Networks

    Also, in order to use the ad network individually, please select the ad network link from the following and refer to the introduction method.

    AD Network Verified version
    maio 1.1.13
    AppLovin 9.14.5
    Unity Ads 3.4.8
    AdColony 4.7.1
    CAReward 2.4.0
    Tapjoy 12.7.0
    Vungle 6.8.0
    Nend 5.4.2
    AMoAd playable-1.0.0
    TikTok 2.0.0.0
    InMobi 9.2.0
    GoogleAdx 20.0.0
    AdFly 0.11.7

Classes and Interfaces

For Android video ad serving, we use the following classes.

  • GNSRewardVideoAd Get video Reward advertisement asynchronously, display class
  • GNSRewardVideoAdListener Reward video advertisement Interface for loading, playing, rewarding and terminating

Implementation of RewardVideo reward advertisement

  1. Import GNSVideoReward.

    import jp.co.geniee.gnadsdk.rewardvideo.GNSRewardVideoAd;
    import jp.co.geniee.gnadsdk.rewardvideo.GNSRewardVideoAdListener;
    import jp.co.geniee.gnadsdk.rewardvideo.GNSVideoRewardData;
    import jp.co.geniee.gnadsdk.rewardvideo.GNSVideoRewardException;
    
    1
    2
    3
    4
  2. Create an instance of GNSRewardVideoAd withZoneID.

    private GNSRewardVideoAd mReward;
    
    setContentView(R.layout.activity_main);
    mReward = new GNSRewardVideoAd("YOUR_ZONE_ID", MainActivity.this);
    
    1
    2
    3
    4
  3. Implement the GNAdVideoListener` interface.

    mReward.setRewardVideoAdListener(new GNSRewardVideoAdListener() {
       @Override
       public void rewardVideoAdDidReceiveAd() {
           Log.i("GNSReward", "Video ad load success");
       }
       @Override
       public void rewardVideoAdDidStartPlaying(GNSVideoRewardData data) {
           Log.i("GNSReward", "Video ad playback start(" + data.adName + ")");
       }
       @Override
       public void didRewardUserWithReward(GNSVideoRewardData data) {
           Log.i("GNSReward", "Give users a reward(" +
           	data.adName + " " + 
           	data.amount + data.type + ")");
       }
       @Override
       public void rewardVideoAdDidClose(GNSVideoRewardData data) {
           Log.i("GNSReward", "Video ad has been closed(" + data.adName + ")");
       }
       @Override
       public void didFailToLoadWithError(GNSVideoRewardException e) {
           Log.i("GNSReward", "Video ad load failed.(" + e.getAdnetworkName() +
           	" Code:" + e.getCode() + " " +
           	 e.getMessage());
       }
    });
    
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
  4. Implement the videoReward loadRequest method.

    • If you're using Geniee SDK version later than 7.0.0
    mReward.loadRequest(isRTB);
    
    1
    • isRTB: true to get ads from RTB (Real Time Bidding), false to get ads from mediation

    • If you're using Geniee SDK version earlier than 7.0.0 such as 6.2.1

    mReward.loadRequest(); // Deprecated
    
    1
    • Load requests can take several seconds or more, so please request video ads as soon as possible.
    • If you want to show another video after the completion of playback of one video, you need to make a load request again.
  5. Confirm that loadRequest method completed successfully withcanShow method and show movie with show method.

    if (mReward.canShow()) {
       mReward.show();
    } else {
       Log.i("GNSReward", "Video ad is loading");
    }
    
    1
    2
    3
    4
    5
    • Be sure to perform the show after executing loadRequest.
  6. Reward the user with the callback method didRewardUserWithReward.

    @Override
    public void didRewardUserWithReward(GNSVideoRewardData data) {
      Log.i("GNSReward", "Give users a reward(" + data.adName + " " + data.amount + data.type + ")"));
    }
    
    1
    2
    3
    4
    • To maximize revenue with Genie's Video Rewards Advertisement it is important to remunerate video viewers. The GNSAdReward method contains the following items:

      • reward.type: Set reward type in SSP
      • reward.amount: setting reward amount at SSP
  7. We will link the activity life cycle to the process. This stitching is used to control stop and restart of advertisements.

    @Override
    protected void onStart() {
       super.onStart();
       if (mReward != null) {
           mReward.onStart();
       }
    }
    
    @Override
    protected void onResume() {
       super.onResume();
       if (mReward != null) {
           mReward.onResume();
       }
    }
    
    @Override
    protected void onPause() {
       if (mReward != null) {
           mReward.onPause();
       }
       super.onPause();
    }
    
    @Override
    protected void onStop() {
       if (mReward != null) {
           mReward.onStop();
       }
       super.onStop();
    }
    
    @Override
    protected void onDestroy() {
       if (mReward != null) {
           mReward.onDestroy();
       }
       super.onDestroy();
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
  • When using video rewind for the whole application Please exclude the implementation of mReward.onDestroy (). Implementing mReward.onDestroy () destroys the data in the video reward.

Description of manifest file

Write the necessary information in the manifest file AndroidManifest.xml.

  1. If you followed the procedure Installing libraries with Maven, you do not need to perform this step.

    Manual introduction procedure here
    • Describe the activity information used by the SDK in <application> in the manifest file.

      <!-- Geniee Reward Video -->
      <activity android:name="jp.co.geniee.gnadsdk.rewardvideo.GNSRewardVideoActivity"
          android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize"
          android:launchMode="singleTop"
          android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
      
      1
      2
      3
      4
      5

Implementation method to display advertisement with higher unit price than

By displaying advertisements after several tens of seconds from the ad ready event, we may increase unit price. This is because, when requesting a plurality of advertisements at the same time to prepare the first advertisement, the application side is notified of the preparation completion, and there is a possibility that the advertisement with a higher unit price becomes ready in a few seconds thereafter That is why. Therefore, by receiving the advertisement acquisition process in advance, it is possible to acquire a higher unit price advertisement.

Last Updated: 5/16/2022, 11:08:18 AM