Rewarded Video
This guide shows how to integrate rewarded video ads of RTBSDK into your app.
This guide shows you how to integrate rewarded video ads of RTBSDK into your app.
Create RTBRewardedVideoAd Instance
Create an instance of RTBRewardedVideoAd:
let rewardedVideoAd = RTBRewardedVideoAd()Listen to Callbacks
Through the use of RTBRewardedVideoAdDelegate, you can listen to the different callbacks. Of course, your class must conform to its delegate methods (see the complete example below).
rewardedVideoAd.delegate = selfRequest Ad
To load a rewarded video ad, you will need to pass an instance of RTBRewardedVideoRequestConfiguration with placementID and the iTunesAppId. Please contact our support for getting the needed IDs.
let configuration = RTBRewardedVideoRequestConfiguration(placementId: <PLACEMENT_ID>, iTunesAppId: "<ITUNES_APP_ID>")
configuration.sellerId = "<SELLERID>"
configuration.bidFloor = <BID_FLOOR>
configuration.muteOnStart = true
rewardedVideoAd.load(configuration: configuration)You will be notified about the loading success/failure through the RTBRewardedVideoAdDelegate
Optional - set user targeting
You can pass user targeting data to each request, allowing ads to be more relevant to your audience. Each field in RTBUserTargeting is optional.
Show Ad
After the ad gets loaded, it can be presented by calling:
The currency of
bidFloorandpriceCPMparameters is USD.
Complete Code Example
Last updated