Hi,
Are changes to UIWebView causing Google adverts to refresh on every appearance?
We are using Google's AdMob SDK (6.11.1) for iOS to display adverts. We only request a new advert when the user enters a new screen. Since iOS 8, whenever an advert goes off and on screen a new advert is loaded. This happens even for adverts in table-cells and could therefore result in a significant increase in requests for adverts which we would like to avoid. We believe this problem is occurring because of changes in the behaviour of UIWebView - the advert view is being informed that it has been reloaded and is therefore requesting a new advert. Here is an example callstack:
#0 0x003f2326 in -[AdvertView adViewDidReceiveAd:]
#1 0x00901cfd in __46-[GADBannerView slotFinishedLoadingAdContent:]_block_invoke ()
#2 0x008f0cd4 in +[GADMacros runSynchronouslyOnMainThreadWithBlock:] ()
#3 0x00901c90 in -[GADBannerView slotFinishedLoadingAdContent:] ()
#4 0x00906b07 in -[GADSlot adFinishedLoadingContent] ()
#5 0x008fd03a in -[GADBannerWebViewDelegate webViewDidFinishLoad:] ()
#6 0x021b1e09 in -[UIWebView webView:didFinishLoadForFrame:] ()
#7 0x021b3d7c in -[UIWebViewWebViewDelegate webView:didFinishLoadForFrame:] ()
#8 0x05924d4d in __invoking___ ()
#9 0x05924bf8 in -[NSInvocation invoke] ()
#10 0x059bc97a in -[NSInvocation invokeWithTarget:] ()
#11 0x0765fe80 in -[_WebSafeForwarder forwardInvocation:] ()
#12 0x0599278e in ___forwarding___ ()
#13 0x0599258e in __forwarding_prep_0___ ()
#14 0x05924d4d in __invoking___ ()
#15 0x05924bf8 in -[NSInvocation invoke] ()
#16 0x08783066 in HandleDelegateSource(void*) ()
#17 0x059657bf in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
#18 0x0595b2cd in __CFRunLoopDoSources0 ()
#19 0x0595a828 in __CFRunLoopRun ()
#20 0x0595a1ab in CFRunLoopRunSpecific ()
#21 0x05959fdb in CFRunLoopRunInMode ()
#22 0x070f724f in GSEventRunModal ()
#23 0x070f708c in GSEventRun ()
#24 0x01ef1386 in UIApplicationMain ()
#25 0x000df73c in main
#26 0x06188ac9 in start ()
Previously the adViewDidReceiveAd: would be called once when we requested an advert. Now it is being called whenever the advert is scrolled off and on screen. We have tried over-riding [GADBannerView slotFinishedLoadingAdContent:] and setting the webView's delegate to nil after loading but this only resulted in the advert disappearing.
Thanks for your help in this matter,
Jock