0

我正在尝试制作广告的演示。当我按照本教程进行操作时。收到此错误使用未声明的类型“GADUnifiedNativeAdLoaderDelegate”。我正在使用最新版本的 GoogleMobileAds.framework。

应用委托

import Firebase

func application(_ application: UIApplication,
      didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    FirebaseApp.configure()

    // Initialize the Google Mobile Ads SDK.
    GADMobileAds.configure(withApplicationID: "ca-app-pub-3940256099942544~1458002511")

    return true
  }

视图控制器

import UIKit
import Firebase
import GoogleMobileAds

class ViewController: UIViewController, GADUnifiedNativeAdLoaderDelegate
4

1 回答 1

1

我正在使用旧版本(7.25.0)的 Admob。最新的是 7.29.0。当我当时在 podfile 中编写pod 'Firebase/AdMob'时,我得到了 7.25.0 版本。然后在我写了pod 'Google-Mobile-Ads-SDK'之后,我得到了 7.29.0 版本的 AdMob。

于 2018-03-19T12:13:07.117 回答