Mitsuhiko Shimomura Mitsuhiko Shimomura - 3 months ago 41
Swift Question

AdMob interstitial error "Request Error: No ad to show"

I'm 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 receive this error:


Request Error: No ad to show.


enter image description here

Answer

Request Error: No ad to show.

means that your request was successful but that Admob has no ad to show for your device at this time. The best way to ensure that you always have ads to show is to use mediation so that an unfulfilled request falls through to another ad network. Admob provides good mechanisms to do that.

Comments