game freezes when using admob interstitial ad

Hello there, Im trying to use admob interstitial ad in a scene dedicated for that matter. when Im testing on device the game freezes when entering the scene ( interAd.lua ) until the app get closed manualy. cant figure out whats the problem tryed many things but non of them worked… help would be apreciated :slight_smile:

build.settings:

  plugins =     {         ["plugin.google.play.services"] =         {             publisherId = "com.coronalabs"         },    ["CoronaProvider.gameNetwork.google"] =    {      publisherId = "com.coronalabs",    },     },  }

main.lua:

local ads = require( "ads" ) if ( system.getInfo( "platformName" ) == "Android" ) then     bannerAppID = "ca-app-pub-4025623736156768/5774085732"  --for your Android banner     interstitialAppID = "ca-app-pub-4025623736156768/2640332533"  --for your Android interstitial end local adProvider = "admob" local function adListener( event )     -- The 'event' table includes:     -- event.name: string value of "adsRequest"     -- event.response: message from the ad provider about the status of this request     -- event.phase: string value of "loaded", "shown", or "refresh"     -- event.type: string value of "banner" or "interstitial"     -- event.isError: boolean true or false     local msg = event.response     -- Quick debug message regarding the response from the library     print( "Message from the ads library: ", msg )     if ( event.isError ) then       print( "Error, no ad received", msg )     elseif ( event.type == "interstitial" ) then       if ( event.phase == "loaded" ) then         print( " ad is ready to be shown" );         -- an ad was preloaded       elseif ( event.phase == "shown" ) then         print( "gameOver" );         composer.gotoScene( "gameOver" );       end     else        print( "Ah ha! Got one!" )     end end ads.init( adProvider, interstitialAppID, adListener )

game.lua:

composer.gotoScene( "interAd", { effect = "fade", time = 400 } );

interAd.lua:

local ads = require( "ads" )

interAd: function scene:show( event )     local sceneGroup = self.view     local phase = event.phase     if ( phase == "will" ) then             elseif ( phase == "did" ) then         if ( ads.isLoaded( "interstitial" ) ) then             ads.show( "interstitial", { appId = interstitialAppID, testMode = true } )         else             print( "gameOver" );             composer.gotoScene( "gameOver" );         end end    end

in gameOver.lua Im loading the interstitial ad every time when play button tapped

It’s likely you’re getting an error of some sort. It’s going to be really hard to trouble shoot this unless you can look at the device’s console log for any messages that might clue us in on the cause.

Please review:  https://docs.coronalabs.com/guide/basics/debugging/index.html

And get us a dump of the console log to look at.

Rob

Unfortunatly I cannot download the files for debugging on device at this moment ill give it a try when I can.

btw, my game is up in the google play store and the ads are working perfectly on it. the moment I released the app this problem started to apear when testing on device only. by any chance admob is blocking the ads of any version of the game that is not in the play store( even of testMode )?

It’s likely you’re getting an error of some sort. It’s going to be really hard to trouble shoot this unless you can look at the device’s console log for any messages that might clue us in on the cause.

Please review:  https://docs.coronalabs.com/guide/basics/debugging/index.html

And get us a dump of the console log to look at.

Rob

Unfortunatly I cannot download the files for debugging on device at this moment ill give it a try when I can.

btw, my game is up in the google play store and the ads are working perfectly on it. the moment I released the app this problem started to apear when testing on device only. by any chance admob is blocking the ads of any version of the game that is not in the play store( even of testMode )?