Rewarded Video Manual Integration iOS

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+. 

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:

#pragma mark - RewardedVideoManualListener
// Indication that Ad is ready, and can be displayed on the device 
- (void) onRewardedVideoAdReady {
}
// Indication that no ad was loaded.
// IronSourceError contains the reason for the failure.
- (void) onRewardedVideoAdLoadFailed(IronSourceError error) {
}
//Called after a rewarded video has changed its availability.
//@param available The new rewarded video availability. YES if available //and ready to be shown, NO otherwise.
- (void)rewardedVideoHasChangedAvailability:(BOOL)available {
     //Change the in-app 'Traffic Driver' state according to availability.
}
// 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 placementInfo An object that contains the placement's reward name and amount.
- (void)didReceiveRewardForPlacement:(ISPlacementInfo *)placementInfo {
}
//Called after a rewarded video has attempted to show but failed.
//@param error The reason for the error
- (void)rewardedVideoDidFailToShowWithError:(NSError *)error {
}
//Called after a rewarded video has been opened.
- (void)rewardedVideoDidOpen {
}
//Called after a rewarded video has been dismissed.
- (void)rewardedVideoDidClose {
}
//Invoked when the end user clicked on the RewardedVideo ad
- (void)didClickRewardedVideo:(ISPlacementInfo *)placementInfo{
}

// -------------------------------------------------------
// Optional events - Are not available for all networks 
// ------------------------------------------------------- 

//Called after a rewarded video has started playing.
- (void)rewardedVideoDidStart {
}

//Called after a rewarded video has finished playing.
- (void)rewardedVideoDidEnd {
}

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: 

+ (void)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 delegate 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.