Admob interstial only showing once?

Hey guys, So im using the Admob paid plugin, init and load the admob interstitial ad.

I show the interstitial ad the first time between scenes

admob.show( “interstitial” )

and it shows and works fine.

Then i call it again later between scenes (exact same call from the same code)

admob.show( “interstitial” )

and it does not show the ad, i tried in both testmode=true and once in testmode=false with the same results.

Im scratching my head as i used the exact same code (different AppIDs) in my previous app in the beginning of January and it works fine, im not sure if there was an update to the plugin which caused this? its only showing the interstitial ad once. i even tried loading the ad again, but that doesn’t help

Using Android by the way. any help is appreciated

Interstitials are a one-time resource.

Once they have been shown, you must load a new interstitial.

BTW. You can check your device log for warnings and errors generated by the plugin.

Thanks so much ingemar_cl :slight_smile:

I did not realize we needed to load an interstitial each time we want to display one
I did try loading again as i mentioned in my post above, but i did that directly after showing the interstitial and that didnt work.

I moved the load interstitial code to the event.phase = “closed” in my adListener so it loads straight after the last one was shown and it works :slight_smile:

Thanks again for the quick response and help!

There was the same problem for the second day I can not solve, “interstitial” is loaded once here here is my code

-- AdMob listener function local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization -- Load an AdMob interstitial ad admob.isLoaded( "interstitial", { adUnitId="ca-app-pub-111111111111111111111111111111" } ) end end -- Sometime later, show the interstitial ad if ( admob.isLoaded( "interstitial" ) ) then admob.show( "interstitial" ) end 

 please tell me

@planshetka.com

After the “init” event you must call admob.load():

admob.load(“interstitial”, { adUnitId=“ca-app-pub-111111111111111111111111111111” })

(You are currently calling admob.isLoaded()which is incorrect…)

Tried and so admob.load(“interstitial”, { adUnitId=“ca-app-pub-111111111111111111111111111111” }) all one “interstitial” is called once

@planshetka.com this is how i got it working, im using your ad listener above and added the closed event phase to reload a new interstial

local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization -- Load an AdMob interstitial ad admob.load( "interstitial", { adUnitId="ca-app-pub-111111111111111111111111111111" } ) end if event.phase == "closed" then if event.type == "interstitial" then admob.load( "interstitial", { adUnitId="ca-app-pub-111111111111111111111111111111"} ) end end end

Thanks for the answer, well, I have one all loaded “interstitial” once, today the whole day with this problem :frowning:

chris_raz

 Thanks again for the advice, I can tell you what I’m doing wrong, I made a scheme of the project, first the menu is loaded, then the transition to the first scene shows “interstitial”, then the transition to the second scene shows “banner”, then the removal of “banner” and the return to the menu, the “banner” work пood, but “interstitial” is shown once

local admob = require( "plugin.admob" ) -- Initialize the AdMob plugin --admob.init( adListener, { appId="ca-app-pub-1188334443482462~5126798990" } ) -- AdMob listener function function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization admob.load( "interstitial", { adUnitId="ca-app-pub-1111111111111111111111111111" } ) admob.load( "banner", { adUnitId="ca-app-pub-2222222222222222222222222222" } ) end end -- Initialize the AdMob plugin admob.init( adListener, { appId="ca-app-pub-333333333333333333333333333333333" } ) function Menu( ) ..... end function MoveScene1( ) GameScene1() end function GameScene1( ) function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization -- Load an AdMob interstitial ad admob.load( "interstitial", { adUnitId="ca-app-pub-1111111111111111111111111111" } ) end if event.phase == "closed" then if event.type == "interstitial" then admob.load( "interstitial", { adUnitId="ca-app-pub-1111111111111111111111111111"} ) end end end -- Sometime later, show the interstitial ad if ( admob.isLoaded( "interstitial" ) ) then admob.show( "interstitial" ) end ..... end function MoveScene2( ) GameScene2() end function GameScene2( ) -- Sometime later, show the banner ad if ( admob.isLoaded( "banner" ) ) then admob.show( "banner" ) end ..... end function MoveMenu( ) admob.hide() Menu() end

Im not sure why you have separate ad listeners for different scenes? you only need the one adListener preferably in the main.lua.

The ad listener that may being called every time is the first one, which does not have the “closed” event phase to reload a new interstitial.

chris_raz

As it does not work at all to implement the display of banners, if it is not difficult you can sample code like this done by you, I will be very grateful I will be very grateful, not how can I not show “interstitial” many times

Interstitials are a one-time resource.

Once they have been shown, you must load a new interstitial.

BTW. You can check your device log for warnings and errors generated by the plugin.

Thanks so much ingemar_cl :slight_smile:

I did not realize we needed to load an interstitial each time we want to display one
I did try loading again as i mentioned in my post above, but i did that directly after showing the interstitial and that didnt work.

I moved the load interstitial code to the event.phase = “closed” in my adListener so it loads straight after the last one was shown and it works :slight_smile:

Thanks again for the quick response and help!

There was the same problem for the second day I can not solve, “interstitial” is loaded once here here is my code

-- AdMob listener function local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization -- Load an AdMob interstitial ad admob.isLoaded( "interstitial", { adUnitId="ca-app-pub-111111111111111111111111111111" } ) end end -- Sometime later, show the interstitial ad if ( admob.isLoaded( "interstitial" ) ) then admob.show( "interstitial" ) end 

 please tell me

@planshetka.com

After the “init” event you must call admob.load():

admob.load(“interstitial”, { adUnitId=“ca-app-pub-111111111111111111111111111111” })

(You are currently calling admob.isLoaded()which is incorrect…)

Tried and so admob.load(“interstitial”, { adUnitId=“ca-app-pub-111111111111111111111111111111” }) all one “interstitial” is called once

@planshetka.com this is how i got it working, im using your ad listener above and added the closed event phase to reload a new interstial

local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization -- Load an AdMob interstitial ad admob.load( "interstitial", { adUnitId="ca-app-pub-111111111111111111111111111111" } ) end if event.phase == "closed" then if event.type == "interstitial" then admob.load( "interstitial", { adUnitId="ca-app-pub-111111111111111111111111111111"} ) end end end

Thanks for the answer, well, I have one all loaded “interstitial” once, today the whole day with this problem :frowning:

chris_raz

 Thanks again for the advice, I can tell you what I’m doing wrong, I made a scheme of the project, first the menu is loaded, then the transition to the first scene shows “interstitial”, then the transition to the second scene shows “banner”, then the removal of “banner” and the return to the menu, the “banner” work пood, but “interstitial” is shown once

local admob = require( "plugin.admob" ) -- Initialize the AdMob plugin --admob.init( adListener, { appId="ca-app-pub-1188334443482462~5126798990" } ) -- AdMob listener function function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization admob.load( "interstitial", { adUnitId="ca-app-pub-1111111111111111111111111111" } ) admob.load( "banner", { adUnitId="ca-app-pub-2222222222222222222222222222" } ) end end -- Initialize the AdMob plugin admob.init( adListener, { appId="ca-app-pub-333333333333333333333333333333333" } ) function Menu( ) ..... end function MoveScene1( ) GameScene1() end function GameScene1( ) function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization -- Load an AdMob interstitial ad admob.load( "interstitial", { adUnitId="ca-app-pub-1111111111111111111111111111" } ) end if event.phase == "closed" then if event.type == "interstitial" then admob.load( "interstitial", { adUnitId="ca-app-pub-1111111111111111111111111111"} ) end end end -- Sometime later, show the interstitial ad if ( admob.isLoaded( "interstitial" ) ) then admob.show( "interstitial" ) end ..... end function MoveScene2( ) GameScene2() end function GameScene2( ) -- Sometime later, show the banner ad if ( admob.isLoaded( "banner" ) ) then admob.show( "banner" ) end ..... end function MoveMenu( ) admob.hide() Menu() end

Im not sure why you have separate ad listeners for different scenes? you only need the one adListener preferably in the main.lua.

The ad listener that may being called every time is the first one, which does not have the “closed” event phase to reload a new interstitial.