1

I try to integrate Admob interstitial in my app and I have a problem - ads show only in simulator.

I use the following code

class MenuViewController: UIViewController, GADInterstitialDelegate {

var interstitial: GADInterstitial?

override func viewDidLoad() {

    loadInterstitial()
}  

func loadInterstitial() {

    var request = GADRequest()
    request.testDevices = ["here is test device id"]

    interstitial = GADInterstitial(adUnitID: "here is ID")
    interstitial!.delegate = self
    interstitial!.loadRequest(GADRequest())

}

override func viewDidAppear(animated: Bool) {

    showAd()

}

func showAd() {

    if !adsRemoved {

        if self.interstitial!.isReady {

            println("interstitial isReady")

            self.interstitial!.presentFromRootViewController(self)

        } else {
            println("intersitial notReady")
        }

    }

    self.interCount = 1

  } 
}

on device it is always printing in console "intersitial notReady" I trued both cases with request.testDevices and without. Both are not working on physical device, but shows in simulator.

also I have

    func interstitialDidFailToReceiveAdWithError (
    interstitial: GADInterstitial,
    error: GADRequestError) {
        println("interstitialDidFailToReceiveAdWithError: %@" + error.localizedDescription)
}

but it is not working

Where can be the problem ?

Alexey K
  • 6,537
  • 18
  • 60
  • 118

0 Answers0