Failed to receive Google Mobile adds

1.1k views Asked by At

I am unable to receive mobile adds in my app.

My code is here:-

-(void) createMObAdds 
{
    bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];

     // Specify the ad unit ID.
     bannerView_.adUnitID = @"d81cb38a93cc479";
     bannerView_.rootViewController = self;
 [self.view addSubview:bannerView_];

 // Initiate a generic request to load it with an ad.
     [bannerView_ loadRequest:[GADRequest request]];
}

- (GADRequest *)request 
{
   GADRequest *request = [GADRequest request];
   request.testDevices = @[GAD_SIMULATOR_ID];
   [request setTesting:YES];
   return request;
}

- (void)adViewDidReceiveAd:(GADBannerView *)adView {
   NSLog(@"Received ad successfully");
}

- (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestError *)error {
   NSLog(@"Failed to receive ad with error: %@", [error localizedFailureReason]);
}

But I am getting ERROR :Request Error: A network error occurred. Please let me know where is the problem in my code or what I need to do ?.

1

There are 1 answers

0
Haresh Ghatala On

Please see below Google Developer Link which guide you step by step

Google Developer AdMob Guide

hope it Help full to you