iOS Admob open app ads issue with black background underneath

Published

I implemented the open app ads (video here: https://www.youtube.com/watch?v=bnqs2A1ff1k&feature=youtu.be)

This looks like the first "Discouraged implementation example" in the official guide: https://support.google.com/admob/answer/9341964?hl=en

In the discouraged example below, the ad is placed after the loading screen and there is no content visible under the ad.

I simply call present in the loading screen like this:

[ad presentFromRootViewController:rootController]

Note that the viewDidDisappear of my loading screen was called just like presenting any normal view controllers, which of course hides the loading screen.

I am wondering how I can keep the original loading screen underneath the ad?

Edit:
I wrote some dummy code to demonstrate it:

#import "ViewController.h"
@import GoogleMobileAds;

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];
  
  // this is a dummy loading screen with bg color
  self.view.backgroundColor = UIColor.blueColor;
  
  [GADAppOpenAd loadWithAdUnitID:@"ca-app-pub-3940256099942544/3419835294" request:[GADRequest request] orientation:UIInterfaceOrientationPortrait completionHandler:^(GADAppOpenAd * _Nullable appOpenAd, NSError * _Nullable error) {

    // dummy 3 seconds loading duration
    [NSTimer scheduledTimerWithTimeInterval:3.0f repeats:NO block:^(NSTimer * _Nonnull timer) {
      
      // present the ad, notice the black color behind the open app ad
      // i.e. the loading screen is gone
      // this is just like the first "Discouraged implementation example" here: https://support.google.com/admob/answer/9341964?hl=en
      [appOpenAd presentFromRootViewController:self];
    }];
  }];
}

@end

Source: Ios Questions

Published
Categorised as admob, ios, uikit Tagged , ,

Answers

Leave a Reply

Your email address will not be published. Required fields are marked *

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq