Rewarded Video Manual Integration Android

In addition to loading ironSource rewarded video ads automatically, you can also set rewarded video ads to load manually. To do this, you must set the entire session loading mode prior to SDK initialization. This is supported from ironSource SDK 7.2.0+ (Beta 7.1.13 Android).

Step 1: Set up rewarded video manual loading

Set the operation mode of rewarded video ads before you initialize the ironSource SDK. By setting the manual mode, you will also create a new listener: RewardedVideoManualListener. 

This listener will trigger callbacks to inform you of ad availability and completions so you’ll know when to display ads and to reward your users.

The SDK will notify your listener of all possible events listed below:

// Set the reward video ads operation to manual, and implement relevant callbacks
IronSource.setManualLoadRewardedVideo(new RewardedVideoManualListener() {
    
    /**   
     * Indication that Ad is ready, and can be displayed on the device 
     */ 
    @Overridee
    public void onRewardedVideoAdReady() {
        
    }
   /** 
    * Indication that no ad was loaded.
    * IronSourceError contains the reason for the failure.
    */                         
    @Override
    public void onRewardedVideoAdLoadFailed(IronSourceError error) {
    }

    // Callbacks that are used both on Manual and Automatic Load 

    /**
     * Invoked when the RewardedVideo ad view has opened. 
     * Note that the activity focus will be changed at this point, till the end is closed. 
     */
    @Override
    public void onRewardedVideoAdOpened() {
    }

   /**
    * Invoked when the RewardedVideo ad view is about to be closed. Your activity will now regain its focus.
    */
    @Override
    public void onRewardedVideoAdClosed() {
    }

    /**
     * Invoked when there is a change in the ad availability status.
     *
     * @param - available - value will change to true when rewarded videos are *available.
     *          You can then show the video by calling showRewardedVideo().
     *          Value will change to false when no videos are available.
     */
    @Override
    public void onRewardedVideoAvailabilityChanged(boolean available) {
    }


     /**
     * Invoked when the user completed the video and should be rewarded.
     * If using server-to-server callbacks you may ignore this events and wait *for the callback from the ironSource server.
     * @param - placement - the Placement the user completed a video from.
     */
    @Override
    public void onRewardedVideoAdRewarded(Placement placement) {
    }

    /** 
     * Invoked when RewardedVideo call to show a rewarded video has failed
     * IronSourceError contains the reason for the failure.
     */
    @Override
    public void onRewardedVideoAdShowFailed(IronSourceError error) {
    }
    
    /**
     * Invoked when the end user clicked on the RewardedVideo ad
     */
    @Override
    public void onRewardedVideoAdClicked(Placement placement) {
    }

    /** 
    * The events AdStarted and AdEnded below are not available for all supported rewarded video ad networks. 
    * Check which events are available per ad network you choose to include in your build.
    * We recommend only using events which will cover all your networks. 
    **/  

   /**
    * Invoked when the video ad starts playing.
    */
     @Override
     public void onRewardedVideoAdStarted(){
     }
     
    /**
     * Invoked when the video ad finishes plating. 
    */
    @Override
    public void onRewardedVideoAdEnded(){
    }
});

Step 2: Manually load rewarded video ads

Request a rewarded video ad d before you plan on showing it to your users as the loading process can take time. Use the following API to load your ad: 

IronSource.loadRewardedVideo();

If you’d like to serve multiple rewarded video ads in your app, you should repeat this step after you’ve shown and closed the previous rewarded video ad. Once the onRewardedAdClosed callback is triggered, you’ll be able to load a new rewarded video ad.

Done!

After defining your operation loading mode to Manual, you can complete your Rewarded Video integration, as described here.