在 GoogleMobileAds 中找不到 GADUnifiedNativeAdView
Can't find GADUnifiedNativeAdView in GoogleMobileAds
在podfile.lock我有
- Google-Mobile-Ads-SDK (8.7.0):
- GoogleAppMeasurement (< 9.0, >= 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'
在Google Ad Manager 8 版本中似乎删除了GADUnifiedNativeAdView
,似乎被GADNativeAdView
取代。
查看迁移指南here。
在podfile.lock我有
- Google-Mobile-Ads-SDK (8.7.0):
- GoogleAppMeasurement (< 9.0, >= 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'在Google Ad Manager 8 版本中似乎删除了GADUnifiedNativeAdView
,似乎被GADNativeAdView
取代。
查看迁移指南here。