Rewarded Video Manual Integration Flutter
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: IronSourceRewardedVideoManualListener.
This listener will trigger callbacks to inform you of ad availability and completions so you’ll know when to display ads and reward your users.
The SDK will notify your listener of all possible events listed below:
/// LevelPlay Listener for Manual Load RV
abstract class LevelPlayRewardedVideoManualListener implements LevelPlayRewardedVideoBaseListener {
/// Indicates that the Rewarded video ad was loaded successfully.
/// - [adInfo] includes information about the loaded ad.
///
/// Native SDK Reference
/// - Android: onAdReady
/// - iOS: didLoadWithAdInfo
void onAdReady(IronSourceAdInfo adInfo);
/// Invoked when the rewarded video failed to load.
///
/// Native SDK Reference
/// - Android: onAdLoadFailed
/// - iOS: didFailToLoadWithError
void onAdLoadFailed(IronSourceError error);
}
Set the listener
IronSource.setLevelPlayRewardedVideoManualListener(listener);
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.