This is part of the code we use. We repeat it in various scenes in our app. We simply used the model provided by the Corona Docs.
local ads = require("ads")
local appIDInterstitial = "ca-app-pub-xxxxx/xxxxx"
local function adListener(event)
local msg = event.response
if event.phase == "loaded" then
end
if (event.isError) then
else
end
end
ads.init("admob", appIDInterstitial, adListener)
Then, during the game, some event is triggered and calls a function which shows the interstitial:
ads.show("interstitial", {appID = appIDInterstitial, testMode = false})
This code is for one of the scenes. There are other scenes similar to this, but which should show banners. The problem is that, when testMode = false, only the first kind of ad shows during the entire game. For example, if I set my game to display in the first scene an interstitial, only the interstitials will show. But if I set it to display in the first scene a banner, only the banners will show.