Hey everyone, I recently started using Corona again after I was gone for a really long time. But now I see I have to pay.subscribe to use ads such as Admob? I still have the code I had before this happened so i was wondering would it still work or will I have to change it and be at an old Corona build?
This is in my main.lua
ads = require("plugin.admob") unusedWidth = display.actualContentWidth - display.contentWidth unusedHeight = display.actualContentHeight - display.contentHeight left = 0 - unusedWidth/2 top = 0 - unusedHeight/2 right = display.contentWidth + unusedWidth/2 bottom = display.contentHeight + unusedHeight/2 bannerID = "ca-app-pub-xxx/xxx" function adListener(event) end ads.init("admob", bannerID, adListener ) ads:setCurrentProvider("admob") ads.load("admob", { appId = bannerID } )
While this is in my game.lua
local function showAd( adPosition ) local xPos, yPos local adPosition = "top" if adPosition == "top" then xPos = display.screenOriginX yPos = top elseif adPosition == "bottom" then xPos = display.screenOriginX yPos = bottom end ads:setCurrentProvider("admob") ads.show( "banner", { x = xPos,y = yPos, appId = bannerID } ) end showAd( "top" ) local function showAd( adPosition ) ads:setCurrentProvider("admob") ads.show( "interstitial", { appId = interstitialID } ) end showAd( "top" )
This has worked on my other game before, but now I am unsure on how to add ads with Admob? Thank you !