Hello, I’m trying to make sense of revmob plugin. The apps are in test mode, but I get no banners shown neither on IOS nor on Android.
Build settings plugins and permissions
local revmob = require( "plugin.revmob" ) local placementID = "xxxxxxxxxxxxxxxxxxxx" local app = "xxxxxxxxxxxxxxxxxxx" if system.getInfo( "platform" ) == 'android' then placementID = "xxxxxxxxxxxxxxxxxxxx" app = "xxxxxxxxxxxxxxxxxxxxx" end local function adListener( event ) if ( event.phase == "sessionStarted" ) then -- Successful initialization -- Load a RevMob ad revmob.load( "banner", placementID ) elseif ( event.phase == "loaded" ) then -- The ad was successfully loaded print( event.type ) -- Show the ad revmob.show( placementID, { yAlign="bottom" } ) elseif ( event.phase == "failed" ) then -- The ad failed to load print( event.type ) print( event.isError ) print( event.response ) end end -- Initialize RevMob revmob.init( adListener, { appId=app } ) revmob.startSession()
I’m getting this in adb logcat: RevMob: RevMob did not answer as expected. (400)
According to the RevMob docs, you don’t need to call “startSession()” except on (perhaps) an “applicationResume” system event. Calling “init()” starts a session automatically.
local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization print("initial initialization") print( event.type ) print( event.isError ) print( event.response ) end end
At a quick look, that look to be what I would expect to appear. The “init” phase does not provide an “event.type” (that is only related to the ad type that would show via another RevMob call).
Basically, it appears that the plugin is initializing properly. My next advice is to test your “sessionStarted” phase conditional block. Can you add a similar “print()” statement there and report what you see in the logcat?
According to the RevMob docs, you don’t need to call “startSession()” except on (perhaps) an “applicationResume” system event. Calling “init()” starts a session automatically.
local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization print("initial initialization") print( event.type ) print( event.isError ) print( event.response ) end end
At a quick look, that look to be what I would expect to appear. The “init” phase does not provide an “event.type” (that is only related to the ad type that would show via another RevMob call).
Basically, it appears that the plugin is initializing properly. My next advice is to test your “sessionStarted” phase conditional block. Can you add a similar “print()” statement there and report what you see in the logcat?