Intersitials Swift ads are not displayed


I am developing an application in Swift and after implementing Admob's Intersitials I can not get it displayed. This is my code, what can happen?

class single_noticia: UIViewController, GADInterstitialDelegate {

var interstitial: GADInterstitial!

override func viewDidLoad() {

    self.interstitial = GADInterstitial(adUnitID: "mipub")

    let request = GADRequest()

    let progressHUD = MBProgressHUD.showHUDAddedTo(self.view, animated: true)
    progressHUD.labelText = "Preguntando en Secretaría"
    progressHUD.mode = .Indeterminate

    //Alamofire JSON GET

    dispatch_async(dispatch_get_main_queue(), {
            MBProgressHUD.hideAllHUDsForView(self.view, animated: true)


In the console I am receiving the following error


Google Can not present interstitial. It is not ready.

asked by Javi Rando 09.04.2016 в 16:07

2 answers


First you have to initialize the ad with a adUnitID valid

self.interstitial = GADInterstitial(adUnitID: "ca-app-pub-XXXXXXXXXXXXX")
let request = GADRequest()

The one you are defining, "mipub" is not valid:

GADInterstitial(adUnitID: "mipub")

You must also define the id of the test device, if you are in the development stage:

request.testDevices = ["XXXXXXXXXXXXXXXXXXXX"]

You can validate to see if your ad is ready to be displayed:

 if self.interstitial.isReady {

You can consult the documentation for more details Announcements interstitial (English)

answered by 11.04.2016 в 00:58

Ads of type Interstitial have enough content and are slow to load x time. That is why as soon as you open the application, you are probably not ready to show up. For this reason, it is not advisable to show it as soon as you open the UIViewController but to show it after an action or event to give it time to load.

On the other hand, you have a function to verify that you are ready to show up like this:

if self.interstitial.isReady {

So that when you want to show the ad, if you are ready, you show it, and if it is not (for example, there is no connection) you do not show it.


If it does not work, you can implement the GADInterstitialDelegate delegate and use the following method to show the ad when it has been downloaded:

func interstitialDidReceiveAd(ad: GADInterstitial!) {



Finally, verify the% test_co_counter by setting the following property:

request.testDevices = ["xxxxxxxxxx"] // Donde las x son el identificador
answered by 10.04.2016 в 10:27