AdMob interjection error "Request error: no ad to show"

I am developing an iOS application using Swift2 and Xcode7. Iโ€™m trying to implement AdMob, but it doesnโ€™t display my interstitial ad.

override func viewDidLoad() { super.viewDidLoad() _interstitial = createAndLoadInterstitial() } func createAndLoadInterstitial()->GADInterstitial { let interstitial = GADInterstitial(adUnitID: "interstitial_ID") let gadRequest:GADRequest = GADRequest() gadRequest.testDevices = ["test device id"] interstitial.delegate = self interstitial?.loadRequest(gadRequest) return interstitial! } func interstitialDidReceiveAd(ad: GADInterstitial!) { _interstitial?.presentFromRootViewController(self) } func interstitial(ad: GADInterstitial!, didFailToReceiveAdWithError error: GADRequestError!) { print(error.localizedDescription) } func interstitialDidDismissScreen(ad: GADInterstitial!) { _interstitial = createAndLoadInterstitial() } 

I get this error:

Request error: Ads are not displayed.

enter image description here

+5
source share
2 answers

Request Error: No ad to show.

means your request was successful, but Admob has no ads for your device at this time. The best way to make sure you always show ads is to use mediation so that an outstanding request falls into another ad network. Admob provides good mechanisms for this.

+6
source

You must have two ad unit identifiers. One for your GADBannerView and one for your GADInterstitial . Make sure the ad unit ID provided by AdMob for your interstitial ad exactly matches what they gave you. Update the latest AdMob SDK , currently 7.5.0. Also consider calling presentFromRootViewController(self) at regular intervals or after the user has completed the required action. The way you are setting now will continue to present interstitial ads one after the other, because you send requests for new interstitial ads every time you are fired, and then displays interstitial text as soon as it receives the ad.

 import UIKit import GoogleMobileAds class ViewController: UIViewController, GADInterstitialDelegate { var myInterstitial : GADInterstitial? override func viewDidLoad() { super.viewDidLoad() myInterstitial = createAndLoadInterstitial() } func createAndLoadInterstitial()->GADInterstitial { let interstitial = GADInterstitial(adUnitID: "Your Ad Unit ID") interstitial.delegate = self interstitial?.loadRequest(GADRequest()) return interstitial } @IBAction func someButton(sender: AnyObject) { myInterstitial?.presentFromRootViewController(self) } func interstitialDidReceiveAd(ad: GADInterstitial!) { print("interstitialDidReceiveAd") } func interstitial(ad: GADInterstitial!, didFailToReceiveAdWithError error: GADRequestError!) { print(error.localizedDescription) } func interstitialDidDismissScreen(ad: GADInterstitial!) { print("interstitialDidDismissScreen") myInterstitial = createAndLoadInterstitial() } 
+3
source

Source: https://habr.com/ru/post/1232449/


All Articles