GADInterstitialDelegate 和 IMInterstitialDelegate 具有相同的函数名称:interstitialDidReceiveAd
//inmob
- (void)interstitialDidReceiveAd:(IMInterstitial *)ad
//callback:(id<IMInterstitialDelegate>)callback
{
[ad presentInterstitialAnimated:YES];
NSLog(@"!!! inmob interstitialDidReceiveAd ok ");
}
// Sent when an interstitial ad request failed
- (void)interstitial:(IMInterstitial *)ad didFailToReceiveAdWithError:(IMError *)error
//callback:(id<IMInterstitialDelegate>)callback
{
NSLog(@"!!! inmob didFailToReceiveAdWithError ");
// NSString *errorMessage = [NSString stringWithFormat:@"Loading ad (%@) failed. Error code: %d, message: //%@", [self.detailItem objectForKey:@"title"], [error code], [error localizedDescription]];
//NSLog(@"%@", errorMessage);
}
//admob
- (void)interstitialDidReceiveAd:(GADInterstitial *)interstitialAdmob
{
NSLog(@"!!! admob interstitialDidReceiveAd ok");
}
- (void)interstitial:(GADInterstitial *)interstitial
//callback:(id<GADInterstitialDelegate>)callback
didFailToReceiveAdWithError:(GADRequestError *)error
{
NSLog(@"!!!!!!! admob interstitial error!");
}
构建错误:方法“interstitialDidReceiveAd:”的重复声明