Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9239729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:03:20+00:00 2026-06-18T08:03:20+00:00

I have setup a test application using Admob Mediation service. I have an issue

  • 0

I have setup a test application using Admob Mediation service. I have an issue that when an error occurs and is handled by a method if I hide the banner View it causes no further ad requests to occur, possibly due to this ‘hidden status’.

What I can do is sleep within the error method for a certain amount of time then request again, however this isn’t the best method… I am guessing this would lock up some process and potentially other user input whilst sleepng? I am not sure of this as the app only includes ads so cannot test.

Here are my methods…

- (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestError *)error;
{
    NSLog(@"Failed to receive ad with error: %@", [error localizedFailureReason]);
    bannerView_.hidden = YES;
    sleep(59);
    [bannerView_ loadRequest:[self createRequest]];
}

- (void)adViewDidReceiveAd:(GADBannerView *)view;
{
    NSLog(@"Ad Received");
    bannerView_.hidden = NO;
}

I am looking for the best way to either:
1. Hide the view when no ad is returned, but ensure requests continue and the ad view is shown again once an ad is received.
2. Use a loop in the error method to handle requesting again until successful and not locking up anything else.

Only being tested on simulator at the moment, if any difference is made.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:03:22+00:00Added an answer on June 18, 2026 at 8:03 am

    I would suggest you to use performSelector to make an asynchronous call instead of using sleep because sleep will block your thread. So this is implemented as in the 1st way you mentioned.

    - (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestError *)error;
    {
        NSLog(@"Failed to receive ad with error: %@", [error localizedFailureReason]);
        bannerView_.hidden = YES;
        [self performSelector:@selector(repeatAdRequest) withObject:nil afterDelay:60.0];
    }
    
    - (void)adViewDidReceiveAd:(GADBannerView *)view;
    {
        NSLog(@"Ad Received");
        bannerView_.hidden = NO;
    }
    
    -(void) repeatAdRequest
    {
        [bannerView_ loadRequest:[self createRequest]];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have setup a test application using Admob Mediation service. The application functions fine,
I have setup an android test project that runs junit tests. It's using two
Using VS2008 TFS I have created a setup application that installs two Window Services.
We have a Python application that polls directories using threads and inotify watchers. We
I have setup a basic test app that displays a view containing a label,
I have a VB6 application, the installer is compiled using INNO Setup. The installer
I have an application that is using Windows Authentication and a SqlRoleProvider for user
I have a legacy VB6 application that was built using MSDE. As many client's
I have the following test setup, all working: -WCF Application running a MathService.svc, setup
Is there a way to have setup/teardown code automagically run before/after each test? Something

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.