Interstitial Ads
Interstitials are either static or video ads presented before, during or after the user interacts with your app. The user can view and then immediately dismiss them. This is a non-rewarded format for the user.
Making the Request
Below is an example of making a request for an Intersitial.
import com.fyber.fairbid.ads.Interstitial
val placementId = "12345"
Interstitial.request(placementId)import com.fyber.fairbid.ads.Interstitial;
String placementId = "12345";
Interstitial.request(placementId);FYBInterstitial.delegate = MyInterstitialDelegate()
let placementId = "1234"
FYBInterstitial.request(placementId)#import <FairBidSDK/FairBid.h>
FYBInterstitial.delegate = [[MyInterstitialDelegate alloc] init];
NSString *placementId = @"1234";
[FYBInterstitial request:placementId];string placementId = "1234";
Interstitial.Request(placementId);Adding Callbacks
The callback code below is required for the SDK to properly track the activity of your ad
Interstitial.setInterstitialListener(object : InterstitialListener {
override fun onShow(placementId: String, impressionData: ImpressionData) {
// Called when the interstitial from placement 'placementId' shows up.
// In case the ad is a video, audio play will start here.
}
override fun onClick(placementId: String) {
// Called when the interstitial from placement 'placementId' is clicked
}
override fun onHide(placementId: String) {
// Called when the interstitial from placement 'placementId' hides.
// In case the ad is a video, audio play will stop here.
}
override fun onShowFailure(placementId: String, impressionData: ImpressionData) {
// Called when an error arises when showing the interstitial from placement 'placementId'
}
override fun onAvailable(placementId: String) {
// Called when an interstitial from placement 'placementId' becomes available
}
override fun onUnavailable(placementId: String) {
// Called when an interstitial from placement 'placementId' becomes unavailable
}
override fun onRequestStart(placementId: String, requestId: String) {
// Called when an interstitial from placement 'placementId' is going to be requested
// 'requestId' identifies the request across the whole request/show flow
}
})Example Showing an Ad
The following example checks to see if a Placement is available and if it is, uses the show request to display the ad.
Last updated

