My admob interstitial ad pops up once then never again

When I start the app everything works. My ad pops up. But after the initial launch I haven’t seen another ad. Does anybody have any answers. I’m testing on a kindle fire 7 and an LG VS930.  Thanks.

Are you ever asking for another ad?

Also if you are only asking for one at startup, your app stays in memory until killed, so your start up code tends to not re-execute.

Rob

Thanks Rob, maybe that’s it. It works somewhat on my LG loading multiple ads but on the kindle. I just get the one ad on the kindle then nothing ever again. Maybe I’ am not asking for another ad but it seems to be working on the LG. Hmmm, any ideas on what I should do? Thanks Rob.

This is my Code Rob, maybe you can let me know if this is correct. Thanks again for the help.

local provider = “admob”
local ads = require (“ads”)
local bannerAppId=“ca-app-pub-###########################”
local interstitialAppId=“ca-app-pub-#########################”

local adProvider=“admob”
local function adListener(event)
    local msg = event.response
    if (event.isError) then
        print("Error, no ad ", msg)
    else
        print(“Found Ad!”)
    end
    
end

ads.init(“admob”, bannerAppId,adListener)
ads.show(“interstitial”,{appId=interstitialAppId, testMode=false})

I think I just figured out what was wrong but maybe I’m wrong Rob. I noticed my bannerId in the place where the interstitialAppId should be. Let me know if there is anything else wrong. Will this be called multiple times or just once?

Nope , that wasn’t it . Tried changing the Id and nothing changed.
 

If you call ads.show() and ask for an interstitial, you get one ad.  There is no auto refresh on them like banners.  You should also look at your console log and see if you’re getting any errors.

Rob

Thank you Rob. So do I need to use a different call then? How do I get more than one interstitial ad to appear while the app is running?

I’ve been searching for information and haven’t been able to see any code examples. Let me know if there is a link that answers this? Thanks again Rob for the quick response.

You need to decide where in your app that you can afford to inject the ad.  Perhaps its after a game level is over before you move to the next level or restart the previous one.  Perhaps your app requires a timer that shows one every 5 minutes of use, or count the number of screen’s they have viewed.    You have to decide what logic works for you.  Just call ads.show() with your parameters at the “right” time.  If you want it every time they start or resume the app, then perhaps you should set up a system event handler and call ads.show() inside the system’s start and resume events.

-- -- handle system events -- local function systemEvents(event)     print("systemEvent " .. event.type)     if event.type == "applicationSuspend" then         --     elseif event.type == "applicationResume" then         -- show an ad here     elseif event.type == "applicationExit" then         --     elseif event.type == "applicationStart" then          -- show an ad here     end     return true end Runtime:addEventListener("system", systemEvents)

Rob

Ok Rob, I nested the ads.show() inside a button that the user will press. It works now but Is it normal to receive the same ad each time? For some reason the ad stays the same. Should it be changing or is this just normal? Thanks again Rob for your quick responses I really appreciate it.

Tried reloading the app and everything works fine Rob. thanks again for your help.

Yes, it’s normal to receive the same ad, in particular when in testing mode.  You’re app doesn’t have the reputation to have more inventory. 

So once google realizes a bunch of people are using your app then more ads will be available is what I’m guessing. Thanks again Rob. Your last name suits you very well. Have an awesome day Rob!

Are you ever asking for another ad?

Also if you are only asking for one at startup, your app stays in memory until killed, so your start up code tends to not re-execute.

Rob

Thanks Rob, maybe that’s it. It works somewhat on my LG loading multiple ads but on the kindle. I just get the one ad on the kindle then nothing ever again. Maybe I’ am not asking for another ad but it seems to be working on the LG. Hmmm, any ideas on what I should do? Thanks Rob.

This is my Code Rob, maybe you can let me know if this is correct. Thanks again for the help.

local provider = “admob”
local ads = require (“ads”)
local bannerAppId=“ca-app-pub-###########################”
local interstitialAppId=“ca-app-pub-#########################”

local adProvider=“admob”
local function adListener(event)
    local msg = event.response
    if (event.isError) then
        print("Error, no ad ", msg)
    else
        print(“Found Ad!”)
    end
    
end

ads.init(“admob”, bannerAppId,adListener)
ads.show(“interstitial”,{appId=interstitialAppId, testMode=false})

I think I just figured out what was wrong but maybe I’m wrong Rob. I noticed my bannerId in the place where the interstitialAppId should be. Let me know if there is anything else wrong. Will this be called multiple times or just once?

Nope , that wasn’t it . Tried changing the Id and nothing changed.
 

If you call ads.show() and ask for an interstitial, you get one ad.  There is no auto refresh on them like banners.  You should also look at your console log and see if you’re getting any errors.

Rob

Thank you Rob. So do I need to use a different call then? How do I get more than one interstitial ad to appear while the app is running?

I’ve been searching for information and haven’t been able to see any code examples. Let me know if there is a link that answers this? Thanks again Rob for the quick response.

You need to decide where in your app that you can afford to inject the ad.  Perhaps its after a game level is over before you move to the next level or restart the previous one.  Perhaps your app requires a timer that shows one every 5 minutes of use, or count the number of screen’s they have viewed.    You have to decide what logic works for you.  Just call ads.show() with your parameters at the “right” time.  If you want it every time they start or resume the app, then perhaps you should set up a system event handler and call ads.show() inside the system’s start and resume events.

-- -- handle system events -- local function systemEvents(event)     print("systemEvent " .. event.type)     if event.type == "applicationSuspend" then         --     elseif event.type == "applicationResume" then         -- show an ad here     elseif event.type == "applicationExit" then         --     elseif event.type == "applicationStart" then          -- show an ad here     end     return true end Runtime:addEventListener("system", systemEvents)

Rob

Ok Rob, I nested the ads.show() inside a button that the user will press. It works now but Is it normal to receive the same ad each time? For some reason the ad stays the same. Should it be changing or is this just normal? Thanks again Rob for your quick responses I really appreciate it.

Tried reloading the app and everything works fine Rob. thanks again for your help.

Yes, it’s normal to receive the same ad, in particular when in testing mode.  You’re app doesn’t have the reputation to have more inventory. 

So once google realizes a bunch of people are using your app then more ads will be available is what I’m guessing. Thanks again Rob. Your last name suits you very well. Have an awesome day Rob!