Hello,
I have almost implement successfuly this Admob Singleton, altough I have a problem with it. I have managed to display the Admob (and iad) banners and the different views managed by different view controllers the application displays modally.
The problem that I have is that when an Admob banner is loaded into one view controller, if another is displayed modally, on clicking on the banner, the advertisement is not displayed on the new view. If I go back to the original view controller (dismissing the modal view), on clicking the banner, the advertisement is displayed correctly.
The same way, if I wait for a new banner to be loaded in the modal view, the advertisement is displayed correctly in the modal view on clicking such banner.
This only happens for AdMob banners and not for iAd.
Any hint you could provide to me to solve the problem?
Thanks in advance
Hi Raj,This issue is still there on 6.2.1 release. In most app, we need to keep the ad banner across views, especially over modal views. The current admob mediation doesn't seem to care the change of the rootviewcontroller property at all unless a new loadRequest is made. But making new requests between views changes will reduce the CTR and is not a good solution for the publisher.This issue can easily be reproduced by
- create an adview and assign its rootviewcontroller
- call loadRequest and tap on the ad, it should work fine at this step
- present another modal view and move the adview into the new modal view and change the rootviewcontroller property to the modal view.
- now click the ad on the modal view and it just won't popup any fullscreen admob ads (iAd is working fine), and the status bar is blanked out.
- on step 4, if we make a loadRequest after the change of rootviewcontroller, then the ad banner works like step 2.
Could you please help?--
The problem is that in some apps with more complex navigation, there are more than 1 UINavigationControllers, or may using a modal view extensively. e.g. it presents an UIWebview to allow user browsing the web without leaving the app. In such case, the webview doesn't belong to the navigation controller and the fullscreen ad will just fail to response to clicks.I read your blog at - http://googleadsdeveloper.blogspot.ca/2012/04/creating-gadbannerview-singleton-in.html and the resetAdView: doesn't change rootViewController at all if the adview is already created. So it will also fail when used against a modal view controller, or any one doesn't share with the original root when it's created.
--
Just did the test for multiple times and I can confirm that this issue only occurs when using mediation ID. When using the admob ID alone as the ad_unit_id, the rootViewController is updated properly and everything is working smooth.
On Tuesday, October 30, 2012 2:35:40 PM UTC-4, Raj Parameswaran wrote:Hey,Just trying to chase down this issue and see what it would take on our side to fix it. Can you check if the rootViewController is updated properly if you don't use mediation?Raj
--
Hello,
I think I am experiencing a similar problem with the Singleton as the ones described here. However, I am not sure I have impleted the code correctly.
1. The application has a UINavagationController. Only in certain (not all) Viewcontrollers that get pushed into the UINavigationController I want to display banners. In the viewWillAppear: method of all the viewControllers that I want the banner to show up, I call the method resetAdView:. However, I am having problems with the following escenario:
- ViewController A: viewWillAppear: DOES NOT call resetAdView: (Banners are NOT showed in this view)
- ViewController B: viewWillAppear: calls resetAdView: (Banners are showed.)
The following sequence of events happens:
è View Controller A pushed.
è View Controller B pushed
è View Controller B popped. (and deallocated)
In this case, the reference ‘currentDelegate_’ (in GADMasterViewController) still points to ViewController B. When adView:(GADBannerView *)view didFailToReceiveAdWithError: gets called I use the currentDelegate_ variable which causes my application to crash. (Isn’t currentDelegate_ a dangling pointer?)
Is there an error on how I am using the singleton? How can I solve this issue? One of the solutions I thought is to set the currentDelegate_ variable of the GADMasterViewController to nil everytime a ViewController dissapears.
2. I have a question about the adViewDidReceiveAd: method. If the only thing I need to do is to display the ad that the app receives (and I am calling resetAdView: in ViewWillAppear: of the viewController). Is there any reason I need to make the ViewControllers still adhere to the GAD protocol and forward the notification?
3. Sometimes I am receiving ads but they are just empty (White Color). I was wondering if this issue is due to some error in my implementation.
Thank you. Bruno
--
Hello Rajkumar,
Thank you for your answer.
1. Yes, I could check if the if currentDelegate_ is nil but in order for that approach to work, shouldn’t ‘[share resetAdView: nil]’ be called in the viewWillDissapear method of all the ViewControllers that display a banner? I am thinking of the situation that I have described in my previous post. If the app popped a viewController that displayed a delegate and the the current one didn’t support the display of ads, then currentDelegate_ will still be pointing to a ViewController that has been deallocated. Is this correct?
3. I am using AdMediation, The AdMob and iAd networks. I am using version 6.2.1. of the AdMob SDK. For he IAd adpater, the one released on October 4th.
Thank you,
Bruno
--
Hello,
I am back to iOS development after some months. Is there any news about this bug? I have tried with the latest version of the SDK and the problem still exist. As admober asked, could you please leave a note when a new version with the bug fix is out?
Thanks
--