简体   繁体   中英

Google Admob Interstitial Add Crash IOS Swift

I have implemented google admob in my IOS app.All other adds are working eg Banner,Native. Interstitial add is also working fine with test id during debugging mode.But when I replaced test key with actual key I got below crash on crashlytics在此处输入图像描述

GADInterstitial.m line 306
__49-[GADInterstitial presentFromRootViewController:]_block_invoke

I have crosschecked keys and code from official google site.Below is the code I am using

     interstitial = GADInterstitial(adUnitID: "ca-app-pub-.....") //test
        interstitial.delegate = self
        let request = GADRequest()
        interstitial.load(request)
if interstitial.isReady {
           interstitial.present(fromRootViewController: self)
         } else {
           print("Ad wasn't ready")
         }

Is the interstitial variable a property on the class or just a local function variable? (sorry, but I do not have enough rep. to comment)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM