let userDefaults = NSUserDefaults.standardUserDefaults()
if userDefaults.boolForKey("adRemoval") {
} else {
myInterstitial = createAndLoadInterstitial()
}
func createAndLoadInterstitial()->GADInterstitial {
let interstitial = GADInterstitial(adUnitID: ADMOB_ADUNITID_INTER)
interstitial.delegate = self
interstitial?.loadRequest(GADRequest())
return interstitial
}
func interstitialDidReceiveAd(ad: GADInterstitial!) {
print("interstitialDidReceiveAd")
}
func interstitial(ad: GADInterstitial!, didFailToReceiveAdWithError error: GADRequestError!) {
print(error.localizedDescription)
}
func interstitialDidDismissScreen(ad: GADInterstitial!) {
print("interstitialDidDismissScreen")
myInterstitial = createAndLoadInterstitial()
}
let userDefaults = NSUserDefaults.standardUserDefaults()
if userDefaults.boolForKey("adRemoval") {
} else {
print("Google Mobile Ads SDK version: " + GADRequest.sdkVersion())
appDelegate.myInterstitial?.presentFromRootViewController(self)
}