Do i need to take it off test mode to see the ad ?
No you should leave testMode on.
If you don’t see ads, please check your device log. Most times there are messages there that explain why ads are not diplayed.
Here’s a guide about debugging in Corona.
https://docs.coronalabs.com/guide/basics/debugging/index.html
This is what I have :
start.lua :
function scene:show(event) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then print("show started") elseif ( phase == "did" ) then print("show showing objects") appodeal.show("interstitial") background:addEventListener("touch", start) end end
main.lua:
local appodeal = require( "plugin.appodeal" ) appodeal.init( adListener, { appKey="appkey", testMode=true} ) local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization -- Show a banner ad elseif ( event.phase == "failed" ) then -- The ad failed to load print( event.type ) print( event.isError ) print( event.response ) end end
The only thing coming out of my console log is :
appodeal.init() WARNING: The Appodeal plugin is only supported on Android, iOS and tvOS devices. Please build for device show started show showing objects appodeal.show() WARNING: The Appodeal plugin is only supported on Android, iOS and tvOS devices. Please build for device
But I tried it out on my android phone and nothing showed . (I used the right app key)
Why is your listener empty? You can’t see what’s going on if you don’t add debug code to it…
This is a broad start. You can improve from there. My guess is you’re not waiting for init to complete before trying to show an add, but without any debug code how can you know what is happening?
local function adListener( event ) for k,v in pairs( event ) do print( k, v ) end print( "---------------------------", system.getTimer() ) end
Also, your code is in the wrong order…
Do this…
local appodeal = require( "plugin.appodeal" ) -- NOT HERE... -- -- adListener hasn't been defined yet.. how do you expect it to be called? --appodeal.init( adListener, { appKey="appkey", testMode=true} ) local function adListener( event ) for k,v in pairs( event ) do print( k, v ) end print( "---------------------------", system.getTimer() ) end -- NOW DO IT... appodeal.init( adListener, { appKey="appkey", testMode=true} )
This is what I have and my console.log is still printing the same thing from before :
main.lua :
local appodeal = require( "plugin.appodeal" ) local function adListener( event ) for k,v in pairs( event ) do print( k, v ) end print( "No ads", system.getTimer() ) end appodeal.init( adListener, { appKey="appkey", testMode=true} ) local composer = require( "composer" ) composer.gotoScene("start")
local appodeal = require( "plugin.appodeal" ) local function adListener( event ) for k,v in pairs( event ) do print( k, v ) end print( "No ads", system.getTimer() ) end appodeal.init( adListener, { appKey="appkey", testMode=true} ) --local composer = require( "composer" ) --composer.gotoScene("start")
figure out why you’re not getting an init response first.
Because the gotoscene should be on top ?
The console.log isn’t printing anything .
Then you have a mystery.
-
Have you ever had this working?
-
Have you run the example with your credentials?
https://github.com/coronalabs/plugins-sample-appodeal
- When you run the sample with your credentials does it work?
I think it’s because I used the wrong app key . I used my api key instead . The problem is , I don’t have an app in the app store so how am I suppose to get an appkey ?
I can’t help you with that.
Are you telling me you haven’t registered with AppoDeal yet?
If you haven’t registered with AppoDeal and gotten credentials yet, then this whole thread has been a waste of time.
This is STEP #1 right on the first page of the plugin docs:
https://docs.coronalabs.com/plugin/appodeal/index.html#registration
Registration
Before you can use this plugin, you must register with Appodeal.
I did register with them .
I got this error :
Oops !
You sent request from invalid bundle_id .
Please , make sure that app bundle_id matches what you have setup in dashboard .
Let’s back up…
I still want an answer for each of these questions:
- Have you ever had this working?
- Have you run the example with your credentials?
https://github.com/coronalabs/plugins-sample-appodeal
-
When you run the sample with your credentials does it work?
-
Have you ever had this working?
- Have you run the example with your credentials?
https://github.com/coronalabs/plugins-sample-appodeal
- When you run the sample with your credentials does it work?
No this is my first time testing this out .
No I did not run that example with my credentials . Do I have to ?
Question #4 - If you don’t have a valid bundle ID, how did register your app with AppoDeal?
You can’t register your app till it is in the store(s). It may also have to be published.
ohh well I guess that’s the problem . I don’t have a valid bundle id .