简体   繁体   English

我可以在阵列上存储Google本地广告吗?

[英]can i store google native ad on array?

i am using google Nativead on my collectionview, First i request for ad then i got five ad at a time then all ad are store in single array like 我在我的collectionview上使用google nativead,首先我请求广告,然后一次获得五个广告,然后所有广告都存储在单个数组中,例如

For example 例如

var nativeAds = [GADUnifiedNativeAd]()

func adLoader(_ adLoader: GADAdLoader, didReceive nativeAd: GADUnifiedNativeAd) {

        nativeAds.append(nativeAd)
}

Then i am using this array on specific collectionview row for display Nativead. 然后我在特定的collectionview行上使用此数组来显示Nativead。 But, my problem is my ad impression is too low around (35, 40)%, so, what i do for displaying Nativead in my collectionview. 但是,我的问题是我的广告展示率太低了(35,40)%,因此,我要如何在collectionview中显示Nativead。 Please help me. 请帮我。

you may add the object to the array when an ad is ready and reload the collection view or you can add an item to the collection view when an ad is received using 您可以在广告准备就绪时将对象添加到数组中,然后重新加载收藏夹视图,也可以在收到广告后使用以下方法将项目添加到收藏夹视图中:

collectionView.insertItems(at: <#[IndexPath]#>)

i think this will help you 我认为这对您有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM