I currently have an Admob Native Express Ad (GADNativeExpressAdView) configured in a UICollectionViewCell.
Problem: The first time the user opens the app and starts scrolling down the list of cells, when they reach the Ad cell, the scrolling blocks until the Native Ad is "built". Once it's done, scrolling continues. The ad then might take a moment (1-2 seconds) to load up the ad request.
Let's say an ad should appear in cell #20, #30, etc, the second time (and every other one after that), the scrolling is uninterrupted. It only happens for the first one.
Any ideas on how to fix this would be really appreciated. Is this a problem with GADNativeExpressAdView itself?
Thank you.
AdCollectionViewCell.Swift
class AdCollectionViewCell: UICollectionViewCell {
@IBOutlet var intercellBanner: GADNativeExpressAdView!
override func awakeFromNib() {
super.awakeFromNib()
let request = GADRequest()
request.testDevices = [kGADSimulatorID]
self.intercellBanner.loadRequest(request)
}
override func prepareForReuse() {
super.prepareForReuse()
let request = GADRequest()
request.testDevices = [kGADSimulatorID]
self.intercellBanner.loadRequest(request)
}
}
Google AdMob Native Ads Playbook - Google AdMob Native ads allow you to customize the ads that appear in your app. Learn the best practices and why you should be using native ads for your app. Native ads allow you to customize the ads that appear in your app. Learn the best practices and why you should be using native ads for your app.
While native ads allow you to customize the ad design the way you want, below are a few general rules of thumb to follow when you’re deciding how your native ads will look: 1. Match the ad design with the look and feel of your app’s content. Align elements and use similar fonts, colors, and styles.
There are two methods available for this: loadAd () and loadAds (). Note: The loadAds () method currently works only with AdMob ads. For mediated ads, use loadAd () instead.
Broadly speaking, there are two parts to successfully implementing Native Ads: loading an ad via the SDK and displaying the ad content in your app. This page is concerned with using the SDK to load native ads . Import the Google Mobile Ads SDK, either by itself or as part of Firebase.
I wrapped line where request is loading with GCD async block and it looks like this approach solved scrolling issue.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), {
view.nativeExpressAdView.loadRequest(request)
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With