Hello,
I’m writing here for my last hope, I’m currently using Adbuddiz as my monetization system on my second app, however, trouble is happening when I call the showAd() function Adbuddiz proposes.
Let me explain the problem, I followed both Corona SDK’s and AdBuddiz’s guides/apis, which means that I enabled the plugin in the config file and that I added this to my app’s files:
in the main.lua:
local composer = require( "composer" ) local AdBuddiz = require "plugin.adbuddiz" AdBuddiz.setAndroidPublisherKey( "TEST\_PUBLISHER\_KEY\_ANDROID" ) AdBuddiz.setTestModeActive() AdBuddiz.cacheAds() composer.gotoScene("menu")
and in my gaveOver.lua scene:
local composer = require( "composer" ) local AdBuddiz = require "plugin.adbuddiz" ... function scene:show( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then ... elseif ( phase == "did" ) then ... if (math.random(1,3) == 1) then AdBuddiz.showAd() else return false end end ... end
(I tried to shorten the code as much as possible and keep the revelant code)
It works perfectly on the Simulator, well, it opens a dialogue box telling me that the showAd() function is only availible on device, but it pops up at the right time, and one a single time.
On device, the ad sometimes shows up before the scene’s transition, and often it shows up multiple times (Shows up one time, you close the ad, shows up another time after having closed the last ad). I don’t see the reason why it would show up before the transition if I set the showAd() function in the “did” phase and I don’t see why it would show up multiple times if the code is being processed through one time only.
Anyone that could help me? Is it a known bug? Or did I fail somewhere?
Thanks in advance,
Philippe R.