'integrating AdMob Native Ads Express in uitableviewcell?
i want to show Native Ads Express in uitableviewcell and i've created custom cell with custom class
import UIKit
import GoogleMobileAds
class GoogleAdsCell: UITableViewCell {
@IBOutlet weak var NativeAds: GADNativeExpressAdView!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
NativeAds.layer.cornerRadius = 2
NativeAds.layer.shadowOffset = CGSizeMake(0, 0)
NativeAds.layer.shadowOpacity = 1.0
NativeAds.layer.shadowRadius = 6
NativeAds.clipsToBounds = true
}
}
and in the viewController at cellForRowAtIndexPath
let adsGoogleCell1 = tableView.dequeueReusableCellWithIdentifier("GoogleAdsCell") as! GoogleAdsCell
adsGoogleCell1.NativeAds.adUnitID = "ca-app-pub-3940256099942544/2562852117"
adsGoogleCell1.NativeAds.rootViewController = self
let request = GADRequest()
request.testDevices = [kGADSimulatorID]
adsGoogleCell1.NativeAds.loadRequest(request)
return adsGoogleCell1
FIRST it works and the ads showed up but after some time it disappeared ?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
