Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/114.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 找不到类型';间隙性';在范围内?_Ios_Swift_Xcode_Admob - Fatal编程技术网

Ios 找不到类型';间隙性';在范围内?

Ios 找不到类型';间隙性';在范围内?,ios,swift,xcode,admob,Ios,Swift,Xcode,Admob,我刚刚将Google Mobile Ads SDK升级到8.0版,但我遇到了以下错误: 在作用域中找不到类型“gadistitual” 我还向AppDelegate添加了以下代码: GADMobileAds.sharedInstance().start(completionHandler: nil) 在我升级到8.0版之前,谷歌移动广告SDK一直运行良好 注意:我的应用程序中也使用了Firebase框架。谷歌在没有告诉任何人的情况下更新了SDK。 请参阅Admob上关于添加间隙的新指南。 本质

我刚刚将Google Mobile Ads SDK升级到8.0版,但我遇到了以下错误:

在作用域中找不到类型“gadistitual”

我还向AppDelegate添加了以下代码:

GADMobileAds.sharedInstance().start(completionHandler: nil)
在我升级到8.0版之前,谷歌移动广告SDK一直运行良好


注意:我的应用程序中也使用了Firebase框架。

谷歌在没有告诉任何人的情况下更新了SDK。 请参阅Admob上关于添加间隙的新指南。 本质上,GADInterstitial已更改为GadInterterstitalad,您也必须使用不同的委托


感谢谷歌的支持。

这是Admob Interstitual的代码,仅供复制和粘贴 我刚刚将谷歌移动广告SDK升级到8.0版

进口谷歌手机 类ViewController:UIViewController、GADFullScreenContentDelegate{

private var interstitial: GADInterstitialAd?
    
override func viewDidLoad() {
    super.viewDidLoad()
    
    let request = GADRequest()
        GADInterstitialAd.load(withAdUnitID:"ca-app-pub-3940256099942544/4411468910",
                                    request: request,
                          completionHandler: { [self] ad, error in
                            if let error = error {
                              return
                            }
                            interstitial = ad
                            interstitial?.fullScreenContentDelegate = self
                          }
        )

}

 func ad(_ ad: GADFullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
   print("Ad did fail to present full screen content.")
 }

 func adDidPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) {
   print("Ad did present full screen content.")
 }

 func adDidDismissFullScreenContent(_ ad: GADFullScreenPresentingAd) {
   print("Ad did dismiss full screen content.")
 }    

@IBAction func AddAction(_ sender: UIButton) {        
    if interstitial != nil {
        interstitial.present(fromRootViewController: self)
      } else {
        print("Ad wasn't ready")
      }
}

}

谷歌移动广告SDK 8.0的API接口发生了巨大变化。请参考谷歌的。为了使其完整,这里是对8.0之前版本的参考

主要更改是委托和Ad类:

古老的 新的 伽达德列盖特 GADFullScreenContentDelegate 间隙的 伽达勒德
根据,GadInterstitual已更名为GadInterstitularadoutstanding为我工作。。。。。。。