Interstitial
First you need to create a request and execute it
self.request = [BDMInterstitialRequest new];
[self.request performWithDelegate:self];
After polling, you need to save the bid request ([BDMRequestStorage.shared saveRequest:request];)
#pragma mark - BDMRequestDelegate
- (void)request:(BDMRequest *)request completeWithInfo:(BDMAuctionInfo *)info {
// After request complete loading application can lost strong ref on it
// BidMachineFetcher will capture request by itself
self.request = nil;
// Save request for bid
[BDMRequestStorage.shared saveRequest:request];
// Here we define which Admob ad should be loaded
[self makeRequest];
}
Then you can create an admob object and load it
- (void)makeRequest {
GADRequest *request = [GADRequest request];
[GADInterstitialAd loadWithAdUnitID:@UNIT_ID request:request completionHandler:^(GADInterstitialAd * _Nullable interstitialAd, NSError * _Nullable error) {
if (error) {
// fail load
} else {
self.interstitial = interstitialAd;
self.interstitial.fullScreenContentDelegate = self;
}
}];
}
Updated over 2 years ago