Refresh Native Ads when refreshing CollectionView Swift

161 views
Skip to first unread message

Conor Jackson

unread,
Jul 14, 2021, 1:36:19 AM7/14/21
to Google Mobile Ads SDK Developers
I got some issues while displaying Native Ads in my Feed collection view. (Swift App)

1. When I try to show more than 25 Native Ads in my Feed collection view, the CPU usage becomes 100+%, and I can't scroll the feed any more. I want to know how I can solve this issue and show more than 25 Native Ads in my feed while I am scrolling down. For your information, I am showing Native Ads every 7 posts in my feed collection view.

2. As a temporary solution, I limited the Native Ads count to 20. This caused about 40% CPU usage and it didn't cause any halt. By the way, I have pull-to-refresh feature in my feed collection view. I wanted to load new Ads when I refresh the feed.
The problem is that if I refresh the feed after I got 20 Ads, scroll down the feed and get more than 10 Ads (so total 30 Ads), the CPU usage becomes 100+% again and the app doesn't respond to user actions.

For your information, I called ad.unregisterAdView() for all old Native Ads and removed them from the list before reloading the feed and Ads.

Any help will be much appreciated.
Conor.

Mobile Ads SDK Forum Advisor

unread,
Jul 14, 2021, 6:01:26 AM7/14/21
to cgj19...@gmail.com, google-adm...@googlegroups.com
Hi Conor,

Thank you for reaching out to us.

With regard to your concern, please do note that it is expected to get a high cpu usage when loading a high number of ads on your app. With this, I'm afraid that the only way to avoid the issue is reduce the number of ads from your app's CollectionView. The recommendation is to limit the number of ads to 5.

Regards,
Google Logo
Teejay Wennie Pimentel
Mobile Ads SDK Team
 

 

ref:_00D1U1174p._5004Q2Kc6eO:ref

Conor Jackson

unread,
Jul 14, 2021, 8:15:25 AM7/14/21
to mobile...@forumsupport.google, google-adm...@googlegroups.com
Thank you for your response. 
I will reduce the number of Ads in my feed collection view.

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/XYNgk000000000000000000000000000000000000000000000QW8BTT00dP2O1JkVSiuSUMCO4SdWLw%40sfdc.net.
Reply all
Reply to author
Forward
0 new messages