Hello!
I made yesterday a game and i put it on Android Market (Google Play) but I don’t know if I do all correctly with InMob.
My build.settings:
settings = { orientation = { default = "landscapeRight", supported = { "landscapeRight" } }, android = { usesPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.READ\_PHONE\_STATE", }, }, plugins = { -- key is the name passed to Lua's 'require()' ["CoronaProvider.ads.inmobi"] = { -- required publisherId = "com.coronalabs", }, }, iphone = { plist = { CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon.png", "Icon@2x.png", }, }, }, }
main.lua:
local ads = require "ads" local function adListener( event ) if event.isError then -- Failed to receive an ad. end end ads.init( "inmobi", "f1d0aab9c822424c98fa7f1bf971b797", adListener ) ads.show( "banner320x48", { x=0, y=100, interval=60, testMode=false } )
and maingame.lua:
local ads = require("ads") local adNetwork = "inmobi" -- the value for appID is the string assigned by InMobi after you create your app local appID = "f1d0aab9c822424c98fa7f1bf971b797" -- not a real app ID ads.init(adNetwork, appID) local showBanner = function() local adX, adY = (display.contentWidth - 320) / 2, display.contentHeight - 48 ads.show( "banner320x48", { x = adX, y = adY, interval = 60, testMode = false } ) end
I made something wrong? Please help me!