Hi,
For a few hours, my ads are not working anymore although I have made no changes in my code.
And all these worked normally yesterday…
Here is my code for the ads:
local ads = require( "ads" ) local bannerAppID = "ca-app-pub-nnnnnnnnnnn/nnnnnnnnn" --for your iOS banner local interstitialAppID = "ca-app-pub-nnnnnnnnnnn/nnnnnnnn" --for your iOS interstitial if ( system.getInfo( "platformName" ) == "Android" ) then bannerAppID = "ca-app-pub-4091388246334706/3327353876" --for your Android banner interstitialAppID = " ca-app-pub-4091388246334706/6070922270" --for your Android interstitial print("entered ads1") end local adProvider = "admob" local function adListener( event ) -- The 'event' table includes: -- event.name: string value of "adsRequest" -- event.response: message from the ad provider about the status of this request -- event.phase: string value of "loaded", "shown", or "refresh" -- event.type: string value of "banner" or "interstitial" -- event.isError: boolean true or false print("entered ads2") local msg = event.response -- Quick debug message regarding the response from the library print( "Message from the ads library: ", msg ) if ( event.isError ) then print( "Error, no ad received", msg ) myData.gotAnAdd = "false" else print( "Ah ha! Got one!" ) myData.gotAnAdd = "true" end end ads.init( adProvider, bannerAppID, adListener ) if (iap.getInventoryValue("unlock")~=true) then if myData.gotAnAdd == "true" then print("Displaying an ad") ads.show( "banner", { x=0, y=1750, appId=bannerAppID } ) end end
And, it seems that the function adListener is never entered as “entered ads2” is never printed in the console log. And there is no error in the console log apart from “ERROR: Unable to resolve host “stats.coronalabs.com”: No address associated with hostname”.
Thanks in advance for your replies
Pierre