Admob ads opening in UITableViewCell instead of new modal window

200 views
Skip to first unread message

satish navada

unread,
Nov 13, 2013, 4:24:35 AM11/13/13
to google-adm...@googlegroups.com
We are using Admob ads inside UITableViewCell . Sometimes the ad contents get opened in the table view cell content itself instead of opening in a new modal view.

The request for ad is done like this:

self.dfpBannerView.adUnitID = unitId;

self.dfpBannerView.delegate=self;

[self.dfpBannerView setRootViewController:delegate];

[self.dfpBannerView loadRequest:[GADRequest request]];


The code is inside Custom TableView Cell.



Williams Martinez

unread,
Nov 13, 2013, 2:58:59 PM11/13/13
to google-adm...@googlegroups.com
Where are you adding the subView?
Could you please post more of your code? Maybe I can help.

satish navada

unread,
Nov 13, 2013, 11:29:37 PM11/13/13
to google-adm...@googlegroups.com
The subview is in the storyboard with IBOutlet for GADBannerView.

The method to request the ad (setUpAd) is in Custom Cell class.

Following method is called from the TableViewViewController's cellforRowAtIndexPath method:


-(void)setUpAd:(UIViewController *) delegate withUnitId:(NSString *)unitId{

   

    DLog(@"ad unit id %@",unitId);

    self.dfpBannerView.adUnitID = unitId;

    self.dfpBannerView.delegate=self;

    [self.dfpBannerView setRootViewController:delegate];

    // Initiate a generic request to load it with an ad.

    [adMob_ActivityIndicator startAnimating];

    

    

    [self.dfpBannerView loadRequest:[GADRequest request]];

Williams Martinez

unread,
Nov 14, 2013, 7:57:00 AM11/14/13
to google-adm...@googlegroups.com
Satish,

Are you implementing the GADBannerViewDelegate methods in your custom cell class?
Also, are you sure the right viewController is in “delegate”?




On 13/11/2013, at 23:29, satish navada <satish...@gmail.com> wrote:

self.dfpBannerView.delegate=self;

satish navada

unread,
Nov 14, 2013, 9:55:25 AM11/14/13
to google-adm...@googlegroups.com
Hi Williams,

Yes. I am making use of the delegate methods and also the ad gets opened in new modal window most of the time.
This weird behavior occurs in some random way. Might be while scrolling faster.

Today , I removed the IBOutlet for the GADBannerView and replaced the code with , programmatically adding a GADBannerView as a subview.
It seems to be working fine. 
Reply all
Reply to author
Forward
0 new messages