I tried to integrate GoogleAdMob - Interstitial for one of my application. here its showing.
interstitial:didFailToReceiveAdWithError: Request Error: No ad to show.
Ad wasn't ready
At AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GADMobileAds configureWithApplicationID:@"AppID Value"];
return YES;
}
At ViewController
static NSString *const GADAdUnitID = @"ADUnitId Value";
#pragma mark - googleAdsMobile
- (GADInterstitial *)createAndLoadInterstitial {
GADInterstitial *interstitial =
[[GADInterstitial alloc] initWithAdUnitID:GADAdUnitID];
interstitial.delegate = self;
GADRequest *request = [GADRequest request];
request.testDevices = @[ @"some value"];
[interstitial loadRequest:request];
return interstitial;
}
/// Tells the delegate an ad request succeeded.
- (void)interstitialDidReceiveAd:(GADInterstitial *)ad {
NSLog(@"interstitialDidReceiveAd");
}
/// Tells the delegate an ad request failed.
- (void)interstitial:(GADInterstitial *)ad
didFailToReceiveAdWithError:(GADRequestError *)error {
NSLog(@"interstitial:didFailToReceiveAdWithError: %@", [error localizedDescription]);
}
/// Tells the delegate that an interstitial will be presented.
- (void)interstitialWillPresentScreen:(GADInterstitial *)ad {
NSLog(@"interstitialWillPresentScreen");
}
/// Tells the delegate the interstitial is to be animated off the screen.
- (void)interstitialWillDismissScreen:(GADInterstitial *)ad {
NSLog(@"interstitialWillDismissScreen");
}
/// Tells the delegate the interstitial had been animated off the screen.
- (void)interstitialDidDismissScreen:(GADInterstitial *)ad {
NSLog(@"interstitialDidDismissScreen");
self.interstitial = [self createAndLoadInterstitial];
}
/// Tells the delegate that a user click will open another app
/// (such as the App Store), backgrounding the current app.
- (void)interstitialWillLeaveApplication:(GADInterstitial *)ad {
NSLog(@"interstitialWillLeaveApplication");
}
No ads showing on application.
Do I need to pay for subscription to googleAdMob for showing ads?
After link with firebase the Admob google i got above Ads. but I do not see real Ads yet. I was confused what I missed to get the application into run real ads on iPhone device.
Once the interstitial test ad from AdMob show prompt the below message.
_userSettingsForUser mobile: {
filterBlacklist = (
);
filterWhitelist = (
);
restrictWeb = 1;
useContentFilter = 0;
useContentFilterOverrides = 0;
whitelistEnabled = 0;
}
I am expecting a real Ad here.