Hello all,
I’ve had code for a while now that has been up to now been able to retrieve ads successfully for admob, with little to no change from project to project, but now for some reason it is failing to display ads. I notice that when I call ads.init, the adListener function does not get called (I have a pop up that would show if it was called no matter what kind of response was sent), so what could cause that? I even tried setting testMode to true in the .show method call, but same problem.
Code:
local function adListener(e) print("Result of AdMob Call : " .. tostring(e.response)); native.showAlert("Debug", tostring(e.response), {"OK"}); --doesnt display end function initialize() \_G.ADS\_INITIALIZED = true; admob = require("ads"); admob.init("admob", APP\_ID, adListener); end
Later, I’m calling either of these two functions, and nothing shows up, and adListener still doesn’t get called:
showInterstitial = function(e) admob.show("interstitial", {x=0, y=0}); end showBannerAd = function(e) local adY = (display.contentHeight - display.screenOriginY); admob.show("banner", {x=0, y=adY}); end
Build.settings:
plugins = { ["CoronaProvider.ads.admob"] = { publisherId = "com.coronalabs", }, }