I am trying to insert ads into my (not yet published) app. All I am doing right now is printing the result of the ads.show to a label named “rsltAd” that is in the position I would like my ad to show up.
When I run the app on my test iPhone6, I get a runtime error that says "Could not load provider (admob) : module “CoronaProvider.ads.admob” not found (and a lot of other error details).
I am thinking maybe my “appId” variable should be the actual “name” of the app, not the Publisher ID that I got from admob when I created my admob account? But this also results in a very similar error message.
During initialization, I execute the following:
local ads = require (“ads”)
local adCount = 0
local appId = “pub-415hugenumber787” – which is really a 16-digit number that is my admob “Publisher ID”
function adListener( event )
if (event.isError) then
rsltAd.text = “AD ERROR”
else
adCount = adCount + 1
rsltAd.text = "AD LOADED " … adCount
end
end
rsltAd = buildLabel ("-", X_LEFT, Y_ADBANNER)
ads.init (“admob”, appId, adListener)
ads.show (“banner”)