Interstitial Ads
This guide shows how to display Interstitial Ads in your application.
What are Interstitial Ads?
How to Display Interstitial Ads
Integrate & Initialize HyprMX
Loading Interstitial Ads
1
let interstitialPlacement = HyprMX.getPlacement("INTERSTITIAL")HyprMXPlacement *interstitialPlacement = [HyprMX getPlacement:@"INTERSTITIAL"];2
if await interstitialPlacement.loadAd() {
print("Ad Available")
}[interstitialPlacement loadAdWithCompletion:^(BOOL success) {
if (success) {
NSLog(@"Ad Available")
}
}];3
/** Called when ad loaded is no longer available for this placement */
func adExpired(placement: HyprMXPlacement) {
}/** Called when ad loaded is no longer available for this placement */
- (void)adExpiredForPlacement:(HyprMXPlacement *)placement {
}placement.expiredDelegate = myPlacementExpiredDelegateInstanceplacement.expiredDelegate = myPlacementExpiredDelegateInstance;Displaying Interstitial Ads
1
interstitialPlacement.isAdAvailable[interstitialPlacement isAdAvailable]2
if interstitialPlacement.isAdAvailable {
interstitialPlacement.showAd(from: self, delegate: self)
}if ([interstitialPlacement isAdAvailable]) {
[interstitialPlacement showAdFromViewController:self delegate:self];
}3
/** Called immediately before attempting to present an ad. */
func adWillStart(placement: HyprMXPlacement) {
}
/** Called upon conclusion of any ad presentation attempt */
func adDidClose(placement: HyprMXPlacement, didFinishAd finished: Bool) {
}
/** Called when an error occurs during ad presentation. */
func adDisplayError(_ error: Error, placement: HyprMXPlacement) {
}
/** Called when an ad has become visible on screen */
func adImpression(placement: HyprMXPlacement) {
}/** Called immediately before attempting to present an ad. */
- (void)adWillStartForPlacement:(HyprMXPlacement *)placement {
}
/** Called upon conclusion of any ad presentation attempt */
- (void)adDidCloseForPlacement:(HyprMXPlacement *)placement didFinishAd:(BOOL)finished {
}
/** Called when an error occurs during ad presentation. */
-(void)adDisplayError:(NSError *)error placement:(HyprMXPlacement *)placement {
}
/** Called when an ad has become visible on screen */
- (void)adImpression:(HyprMXPlacement *)placement {
}Last updated
