I have set up inmobi ads, but corona simulator gives warning “plugin.inMobi” library is not available on this platform, so I built it for android there is no error while building. But when I open my app, after installation, ads doesn’t show up. My app is in development mode.These are my files:
build.settings:
settings = { orientation = { default = "portrait", supported = { "portrait", }, }, android = { usesPermissions = { "android.permission.INTERNET", }, }, plugins = { ["plugin.inMobi"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, }, }
main.lua:
local inMobi = require( "plugin.inMobi" ) -- Pre-declare a placement ID local placementID = "PLACEMENT\_ID" local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization -- Load a banner ad inMobi.load( "banner", placementID ) elseif ( event.phase == "loaded" ) then -- The ad was successfully loaded print( event.type ) print( event.placementId ) elseif ( event.phase == "failed" ) then -- The ad failed to load print( event.type ) print( event.placementId ) print( event.isError ) print( event.response ) end end -- Initialize the InMobi plugin inMobi.init( adListener, { accountId="ACCOUNT\_ID" } )
Thank you for the help.