Can't find GADUnifiedNativeAdView in GoogleMobileAds

Viewed 160

in podfile.lock i have

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

this code works fine, so sdk installed successfully

import GoogleMobileAds

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

but i can display received GADNativeAd because views are unaccessible

import UIKit
import GoogleMobileAds

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

Got : Cannot find 'GADUnifiedNativeAdView' in scope

1 Answers

It seems that GADUnifiedNativeAdView has been removed in the 8 version of Google Ad Manager,and it seems to be replaced with GADNativeAdView.

Check the migration guide here.

Related