I just upgraded Google Mobile Ads SDK to version 8.0, but I am getting this error:
Cannot find type ‘GADInterstitial’ in scope
I also added this code to AppDelegate:
GADMobileAds.sharedInstance().start(completionHandler: nil)
Google Mobile Ads SDK worked perfectly until I upgraded to version 8.0
Note: I also use Firebase Framework in my app.
3
Answers
Google have updated the SDK without telling anyone.
Take a look at the new guide on Admob for adding an interstitial.
Essentially GADInterstitial has changed to GADInterterstitialAd and you have to use a different Delegate too.
Thanks for that Google.
Here this is the code of Admob Interstitial only copy and paste
I just upgraded Google Mobile Ads SDK to version 8.0
}
Google Mobile Ads SDK 8.0 has a dramatic change of its API interfaces. Please refer to Google’s official document for Interstitial. To make it complete, here is the reference to the legacy API prior to 8.0.
The main changes are the delegate and the Ad class:
And instead of initializing the Ad in the legacy way:
it’s now initialized in the following way
And the new GADFullScreenContentDelegate methods:
Note there is no longer the
interstitialDidReceiveAd
method. Instead you either start to present the Ad in theGADInterstitialAd.load()
completion call back, or at a later stage to present the Ad if it is initialized: