Admob banner disappears after interstitial is closed (iOS)

Hi,

I noticed a strange behavior of banners since I have updated to AdMob v2.

I successfully implemented both banner and interstitial on iOS but after an interstitial is shown and closed the banner previously shown disappears. It doesn’t refresh and there are no chances to see it later.

This problem doesn’t happen on Android.

I logged the app while this problem and every time an interstitial is shown, I can read the following creepy log:

Generic error: NSInvalidArgumentException: *** +[NSString stringWithCString:encoding:]: NULL cString

(

0   CoreFoundation                      0x03efc1e4 __exceptionPreprocess + 180

1   libobjc.A.dylib                     0x03a9e8e5 objc_exception_throw + 44

2   CoreFoundation                      0x03efbfbb +[NSException raise:format:] + 139

3   Foundation                          0x005ae376 +[NSString stringWithCString:encoding:] + 90

4   Ueue                                0x00225bf6 _ZN6Corona16IOSAdMobProvider4ShowEP9lua_StatePKci + 60

5   Ueue                                0x002257f1 _ZN6Corona16IOSAdMobProvider4ShowEP9lua_State + 77

6   Ueue                                0x00098d41 _ZNK3Rtt12VideoTexture9GetFilterEv + 331321

7   Ueue                                0x000aca77 _ZNK3Rtt12VideoTexture9GetFilterEv + 412527

8   Ueue                                0x000991a7 _ZNK3Rtt12VideoTexture9GetFilterEv + 332447

9   Ueue                                0x0008fa81 _ZNK3Rtt12VideoTexture9GetFilterEv + 293753

10  Ueue                                0x000add52 _ZNK3Rtt12VideoTexture9GetFilterEv + 417354

11  Ueue                                0x000994f1 _ZNK3Rtt12VideoTexture9GetFilterEv + 333289

12  Ueue                                0x0008fa3d _ZNK3Rtt12VideoTexture9GetFilterEv + 293685

13  Ueue                                0x000c9e8e _ZNK3Rtt12VideoTexture9GetFilterEv + 532358

14  Ueue                                0x000c9cc2 _ZNK3Rtt12VideoTexture9GetFilterEv + 531898

15  Ueue                                0x0022653e _ZNK6Corona16IOSAdMobProvider13DispatchEventEbPKcS2_S2_ + 290

16  Ueue                                0x002277f7 _ZNK6Corona16IOSAdMobProvider13DispatchEventEbPKcS2_S2_ + 5083

17  Ueue                                0x00241276 _ZNK6Corona16IOSAdMobProvider13DispatchEventEbPKcS2_S2_ + 110170

18  Ueue                                0x002400ac _ZNK6Corona16IOSAdMobProvider13DispatchEventEbPKcS2_S2_ + 105616

19  Ueue                                0x0024115a _ZNK6Corona16IOSAdMobProvider13DispatchEventEbPKcS2_S2_ + 109886

20  Ueue                                0x00231940 _ZNK6Corona16IOSAdMobProvider13DispatchEventEbPKcS2_S2_ + 46372

21  Ueue                                0x00233f23 _ZNK6Corona16IOSAdMobProvider13DispatchEventEbPKcS2_S2_ + 56071

22  libobjc.A.dylib                     0x03ab0880 -[NSObject performSelector:withObject:withObject:] + 77

23  UIKit                               0x029203b9 -[UIApplication sendAction:to:from:forEvent:] + 108

24  UIKit                               0x02920345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61

25  UIKit                               0x02a21bd1 -[UIControl sendAction:to:forEvent:] + 66

26  UIKit                               0x02a21fc6 -[UIControl _sendActionsForEvents:withEvent:] + 577

27  UIKit                               0x02a21243 -[UIControl touchesEnded:withEvent:] + 641

28  UIKit                               0x0295fddd -[UIWindow _sendTouchesForEvent:] + 852

29  UIKit                               0x029609d1 -[UIWindow sendEvent:] + 1117

30  UIKit                               0x029325f2 -[UIApplication sendEvent:] + 242

31  UIKit                               0x0291c353 _UIApplicationHandleEventQueue + 11455

32  CoreFoundation                      0x03e8577f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15

33  CoreFoundation                      0x03e8510b __CFRunLoopDoSources0 + 235

34  CoreFoundation                      0x03ea21ae __CFRunLoopRun + 910

35  CoreFoundation                      0x03ea19d3 CFRunLoopRunSpecific + 467

36  CoreFoundation                      0x03ea17eb CFRunLoopRunInMode + 123

37  GraphicsServices                    0x0424d5ee GSEventRunModal + 192

38  GraphicsServices                    0x0424d42b GSEventRun + 104

39  UIKit                               0x0291ef9b UIApplicationMain + 1225

40  Ueue                                0x000030dd start + 157

41  Ueue                                0x00003075 start + 53

42  ???                                 0x00000001 0x0 + 1

)

(Ueue is the name of the app).

The code is quite simple as you can check here:

local platName = system.getInfo( "platformName" ) local bannerId = {ios = "ca-app-pub-xxxxxxxx1",android="ca-app-pub-xxxxxxxx2"} local interstitialId = {ios = "ca-app-pub-xxxxxxxx3",android="ca-app-pub-xxxxxxxx4"} local flurryId = {ios = "ABCDEFG", android = "HIJKLMNO"} -- ANALYTICS AREA local analytics = require ("analytics") local ga = require("GoogleAnalytics.ga") -- END ANALYTICS --ADS AREA local ads = require( "ads" ) local shownBanner = bannerId.ios local shownInterstitial = interstitialId.ios local shownFlurry = flurryId.android local function adListener( event ) if ( event.isError ) then print("error") elseif ( event.phase == "loaded" ) then -- an ad was preloaded print ("loaded") elseif ( event.phase == "shown" ) then ads.show( { x=display.screenOriginX, y=0 } ) print ("shown") end end local function showInterstitial () ads.show( "interstitial", { appId=shownInterstitial} ) end if platName == "Android" then shownBanner = bannerId.android shownInterstitial = interstitialId.android shownFlurry = flurryId.android end -- BOTH ANALYTICS AND ADVERTISING AREA analytics.init( shownFlurry ) ads.init( "admob", shownBanner, adListener ) ads.show( "banner", { x=display.screenOriginX, y=0, appId=shownBanner } ) timer.performWithDelay( 45000, showInterstitial ) -- shows the interstitial after 45 seconds

Did you experience a similar issue?

Thanks in advance!

g

Hi,

anyone from Corona Labs here, please?

Thanks!

Please, Does anyone from Corona have an answer, a clue or a suggestion?

Here you can find the video of the issue.

I re-produced it with less code than the example above. You just need to implement both interstitial and banner in order to reproduce the bug:

https://dl.dropboxusercontent.com/u/14095545/hiding_banner.m4v

Thanks,

g

Have you tried to call ads.hide() before you try and show your interstitial?  Are there any other errors?  Are you printing out any results from the ad listener?

Rob

Hi Rob,

thanks for your help. I used the following code in order to prevent the problem described above and it worked:

local function adListener( event ) if (event.type == "interstitial") then if (event.phase == "shown") then ads.show( "banner", { x=0, y=0, appId=xxxxxxxx } ) end end end

Hi,

anyone from Corona Labs here, please?

Thanks!

Please, Does anyone from Corona have an answer, a clue or a suggestion?

Here you can find the video of the issue.

I re-produced it with less code than the example above. You just need to implement both interstitial and banner in order to reproduce the bug:

https://dl.dropboxusercontent.com/u/14095545/hiding_banner.m4v

Thanks,

g

Have you tried to call ads.hide() before you try and show your interstitial?  Are there any other errors?  Are you printing out any results from the ad listener?

Rob

Hi Rob,

thanks for your help. I used the following code in order to prevent the problem described above and it worked:

local function adListener( event ) if (event.type == "interstitial") then if (event.phase == "shown") then ads.show( "banner", { x=0, y=0, appId=xxxxxxxx } ) end end end