Good day!

I added ads in full screen, everything works only when you first touch on a specific UIView.

How to show ads on every 5th touch of any part of the screen

-(void) viewDidLoad { UITapGestureRecognizer * BanerAppear =[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(bannerApearAdMob)]; [self.selfBannerAdMob addGestureRecognizer:BanerAppear]; self.interstitial = [[GADInterstitial alloc] initWithAdUnitID:@"ca-app-pub-xxxxxxxxx/xxxxxx"]; request1 = [GADRequest request]; request1.testDevices = @[ kGADSimulatorID ]; [self.interstitial loadRequest:request1]; } - (void)bannerApearAdMob{ if (self.interstitial.isReady) { [self.interstitial presentFromRootViewController:self]; } } 

    1 answer 1

    Add a counter and show ads on it. For example:

     - (void)bannerApearAdMob{ if (_counter >= 5) { if (self.interstitial.isReady) { _counter = 0; [self.interstitial presentFromRootViewController:self]; //запрос загрузки новой рекламы, если не реализовано в методе делегата закрытия баннера/еще где. } } else { _counter += 1; } } 
    • Thank you very much! it helped but only for the appearance with 5+ touches, but the repetition does not work tried through recursion though it is not very good but also did not help ... - Void
    • I apologize for what you meant in a comment? - Void
    • @ Abs3akt after displaying ads need to load ads. For example, after closing an advertisement: firebase.google.com/docs/admob/ios/interstitial listing the code after the title Only Show GADInterstitial once - VAndrJ
    • Thank you very much! figured out - Void