My Settings:
settings = { plugins = { ["CoronaProvider.ads.admob"] = { publisherId = "com.coronalabs", }, }, android = { usesPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.READ\_PHONE\_STATE", }, }, orientation = { --default = "landscapeRight", }, iphone = { plist= { UIStatusBarHidden=true, UIAppFonts = { "SnackerComic.ttf" }, UIApplicationExitsOnSuspend = true }, }, }
My code:
-- Load Corona 'ads' library local ads = require "ads" local function adListener( event ) if event.isError then --event Failed to receive an ad. print("Failed to receive an ad.") else print('Ad success') end end ads.init( "admob", "ca-app-pub-3611746718456623/1151739395", adListener )
Then… code to show ads when a game is lost:
ads.show( “banner”, { x=display.contentWidth/2, y=display.contentHeight/2} )
The app slows down like it’s loading an add (2 second pause), but then nothing displays, and the game carries on as normal.
I’m testing the app out on a Samsung Galaxy Tab 2 device.