Hi Alex, I integrated both iAds and inneractive, using the method you described in post #63 above. The problem is, when I set the ads:setCurrentProvider to “inneractive”, I don’t get any adListener response. The inneractive fullscreen ads do appear, but my app doesn’t know that it has appeared, and it ends up hanging my app after I close the inneractive fullscreen ad. Is this a bug? Or am I doing something wrong? Please see below the relevant code that I extracted from mine and let me know your thoughts.
Naomi
Edit: incomplete code updated
[code]
– in main.lua
_G.initAds = false
– in menu.lua
local showAds = require( “showAds” )
if _G.initAds == false then showAds.startAds() end
– in showAds.lua
local M = {}
local adListener
local adType, adParam
local adX, adY, adInterval, adTest
function M.startAds()
_G.initAds = true;
local appID = “com.mycompany.myapp”
ads.init( “iads”, appID, adListener )
if (string.sub( myDevice.model,1,4) == “iPad”) then
appID = “mycompany_myapp_iPad”
ads.init( “inneractive”, appID, adListener )
else
appID = “mycompany_myapp_iPhone”
ads.init( “inneractive”, appID, adListener )
end
end
function adListener(event)
print("--------------- inside adListener ----------------")
– event table includes:
– event.provider (e.g. “inneractive” or “iads”)
– event.isError (e.g. true/false )
print("event.response = " … tostring(event.response))
print("event.provider = " … tostring(event.provider))
print("event.isError = " … tostring(event.isError))
print("adType = " … tostring(adType))
print("adNetwork = " … tostring(adNetwork))
if adType == “full” then
if event.isError then
ads.hide()
– show house ads here
else
– fullscreen interstitial ad is being displayed
– behind the screen, update my app to advance to the next screen
timer.performWithDelay( 2000, M.goNext )
end
else
– banner ads
end
end
function M.show(doNext)
M.goNext = doNext
adType = “full”
adNetwork = “inneractive”
adX=0; adY=0; adInterval=180; adTest=false;
adParam = “fullscreen”
ads:setCurrentProvider(adNetwork)
if adNetwork == “inneractive” then
ads.show( adParam, { x=adX, y=adY, interval=adInterval, testMode=adTest } )
end
end
– in a scene module where I want to show ads
local function nextScreen()
– here I have routine that advances the screen to the next screen that
– I want to show after the ads are closed
end
showAds.show( nextScreen )
[/code] [import]uid: 67217 topic_id: 34226 reply_id: 144991[/import]