Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

iOS ads not displayed in UITableViewCell

322 views
Skip to first unread message

DemDev

unread,
May 29, 2014, 9:20:37 AM5/29/14
to google-adm...@googlegroups.com
Hello

I do have a problem with ads in my application. I did successfully add ads to one of my UIViewControllers(with help of this group) and I wanted to add ads in one of the UITableViews.
 
I have decided to create new cell prototype with DFPBannerView inside and add at 2nd, 7th and 12th position in table. I've added following code to do this: http://pastebin.com/kLg7LMH4
From time to time I do see ad appearing in one of the three cells, but it's rather rare. 

I would assume that it might be because of the reusing the cells in UITableView but I am not sure how to resolve it. 

Thank you

Eric Leichtenschlag

unread,
May 30, 2014, 7:56:12 PM5/30/14
to google-adm...@googlegroups.com
We have an example here which shows how to run ads in a UITableView. The slight difference in this example is there is an ad at the top and bottom of the list instead of every k elements and the banner view is reused, where your code looks like every table view element could have a banner. The reason the sample can get away with using one banner view is per AdMob policy, 2 ads can't be on the same screen anyways.

One difference I noticed between your code and the sample is the sample checks if an ad request has already been made on that cell's banner. If you're scrolling a lot, you may be constantly trying to request ads which isn't a good practice. Anyhow, check out and run the example to see if it works for you, and if so you can use that code as a reference.

Thanks,
Eric
Reply all
Reply to author
Forward
0 new messages