I have been trying to get video ads to work for a while now but the video ads always fail to load. When I try to load banner or interstitial ads it works perfectly fine. Here is my code:
BUILD SETTINGS:
-- -- For more information on build.settings see the Corona SDK Build Guide at: -- http://docs.coronalabs.com/guide/distribution/buildSettings/index.html -- settings = { orientation = { -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight default = "portrait", supported = { "portrait", } }, excludeFiles = { -- Include only the necessary icon files on each platform iphone = { "Icon-\*dpi.png", }, android = { "Icon.png", "Icon-Small-\*.png", "Icon\*@2x.png", }, }, -- -- iOS Section -- iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-167.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", }, --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXX", -- replace XXXXXXXXX with your Facebook appId } } } --]] } }, plugins = { ["plugin.revmob"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, }, -- -- Android Section -- android = { usesPermissions = { "android.permission.INTERNET", }, }, }
Main.lua code:
local revmob = require( "plugin.revmob" ) local placementID = "575b8bbc6d85024b0b88aa01" local function adListener( event ) if ( event.phase == "sessionStarted" ) then -- Successful initialization -- Load a RevMob ad revmob.load( "rewardedVideo", placementID ) elseif ( event.phase == "loaded" ) then -- The ad was successfully loaded print( event.type ) revmob.show( placementID, { yAlign="bottom" } ) elseif ( event.phase == "failed" ) then -- The ad failed to load print( event.type ) print( event.isError ) print( event.response ) revmob.init( adListener, { appId="575b1bc08ffef6705da33497" } ) end end -- Initialize RevMob revmob.init( adListener, { appId="575b1bc08ffef6705da33497" } )
The code definitely works for banner and interstitial. I have tried to get both “video” and “rewardedVideo” ad unit types to work but they dont seem to show up. If anyone has a solution your help would be appreciated.
Thanks.