Interstitial - Atmosplay/AtmosplayAds-iOS GitHub Wiki
Create an interstitial ad object
Interstitial ads are requested and shown by AtmosplayInterstitial
objects.
The first step in using one is to instantiate it and set its App ID, ad unit ID.
For example, here's how to create a AtmosplayInterstitial
:
#import <AtmosplayAds/AtmosplayInterstitial.h>
@interface AtmosplayInterstitialViewController () <AtmosplayInterstitialDelegate>
@property (nonatomic) AtmosplayInterstitial *interstitial;
@end
@implementation AtmosplayBannerViewController
- (void)createAndLoadInterstitial {
self.interstitial = [[AtmosplayInterstitial alloc] initWithAppID:@"Your_App_ID" adUnitID:@"Your_AdUnitID"];
self.interstitial.delegate = self;
self.interstitial.autoLoad = YES;
[self.interstitial loadAd]
}
@end
Show the ad
- (void)showInterstitial {
// ad is not ready, do nothing
if (!self.interstitial.ready) {
return;
}
// show the ad
[self.interstitial showInterstitialWithViewController:self];
}
Implementing interstitial events
/// Tells the delegate that succeeded to load ad.
- (void)atmosplayInterstitialDidLoad:(AtmosplayInterstitial *)ads {
}
/// Tells the delegate that failed to load ad.
- (void)atmosplayInterstitial:(AtmosplayInterstitial *)ads didFailToLoadWithError:(NSError *)error {
}
/// Tells the delegate that user starts playing the ad.
- (void)atmosplayInterstitialDidStartPlaying:(AtmosplayInterstitial *)ads {
}
/// Tells the delegate that the ad is being fully played.
- (void)atmosplayInterstitialDidEndPlaying:(AtmosplayInterstitial *)ads {
}
/// Tells the delegate that the landing page did present on the screen.
- (void)atmosplayInterstitialDidPresentLandingPage:(AtmosplayInterstitial *)ads {
}
/// Tells the delegate that the ad did animate off the screen.
- (void)atmosplayInterstitialDidDismissScreen:(AtmosplayInterstitial *)ads {
}
/// Tells the delegate that the ad is clicked
- (void)atmosplayInterstitialDidClick:(AtmosplayInterstitial *)ads {
}