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() }
source share