【问题标题】:Can't find GADUnifiedNativeAdView in GoogleMobileAds在 GoogleMobileAds 中找不到 GADUnifiedNativeAdView
【发布时间】:2021-10-18 08:27:07
【问题描述】:

在 podfile.lock 我有

  • Google-Mobile-Ads-SDK (8.7.0):
    • GoogleAppMeasurement (= 7.0)
    • GoogleUserMessagingPlatform (>= 1.1)

这段代码运行正常,所以sdk安装成功

import GoogleMobileAds

 let options = GADMultipleAdsAdLoaderOptions()
 options.numberOfAds = 5
 adLoader = GADAdLoader(adUnitID: adUnitID, rootViewController: requester, adTypes: [.native], options: [options])
 adLoader.delegate = self

但我可以显示收到的 GADNativeAd,因为无法访问视图

import UIKit
import GoogleMobileAds

class FeedAdTVC: UITableViewCell {
    
    func setup(with: GADNativeAd) {
        let templateView = GADUnifiedNativeAdView()
    }
}

得到:在范围内找不到“GADUnifiedNativeAdView”

【问题讨论】:

    标签: ios swift firebase google-ads-api googlemobileads


    【解决方案1】:

    好像GADUnifiedNativeAdView在Google Ad Manager 8版本中被去掉了,好像换成了GADNativeAdView

    查看迁移指南here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-26
      • 1970-01-01
      • 2017-10-22
      • 2016-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多