Okay so I want to use AppNext advertisement in my game am being unsuccessful. Here’s my current code for the add:
local appnext = require( "plugin.appnext" ) local fullscreenPlacementID fullscreenPlacementID = "my ID here" local videoConfig = { ShowClose = true, CloseDelay = 5.5 } local fullscreenAdKey = appnext.createAd( "fullscreen", fullscreenPlacementID, videoConfig ) appnext.loadAd( fullscreenAdKey ) if ( appnext.adIsLoaded( fullscreenAdKey ) ) then appnext.showAd( fullscreenAdKey ) else errorshow=display.newText("Cant fetch add! ",error.x,error.y,"mycustomfont.ttf", 50 ) end
As you can see in the code above, I display “Cant fetch add!” in case of error. When I test the app on mobile, it still displays “Cant fetch add!”.
Can the reason be AppNext not providing ads till my application is live in the stores? Or am I doing something wrong?
Thanks!
Hi @mostwanted_1996,
Did you initialize the AppNext plugin? Every ad provider I can think of needs to be initialized first, in some way or another, typically via that plugin’s “init()” function.
https://docs.coronalabs.com/plugin/appnext/init.html
Best regards,
Brent
I have been using Appnext for one of my apps recently. So far I love it. Nice eCPM and the ads look completely different than most ads (which I like since it breaks up the monotony of sameness.
Anyway here is my code:
As Brent said init it:
appnext.init( appnextListerner ) local interPreferences = { PreferredOrientation="portrait" } appNextInterAppKey = appnext.createAd( "interstitial", appId, interPreferences )
Load the add:
appnext.loadAd( appNextInterAppKey )
Check if it is loaded to show:
if appnext.adIsLoaded( appNextInterAppKey ) then appnext.showAd( appNextInterAppKey ) end
Hi @mostwanted_1996,
Did you initialize the AppNext plugin? Every ad provider I can think of needs to be initialized first, in some way or another, typically via that plugin’s “init()” function.
https://docs.coronalabs.com/plugin/appnext/init.html
Best regards,
Brent
I have been using Appnext for one of my apps recently. So far I love it. Nice eCPM and the ads look completely different than most ads (which I like since it breaks up the monotony of sameness.
Anyway here is my code:
As Brent said init it:
appnext.init( appnextListerner ) local interPreferences = { PreferredOrientation="portrait" } appNextInterAppKey = appnext.createAd( "interstitial", appId, interPreferences )
Load the add:
appnext.loadAd( appNextInterAppKey )
Check if it is loaded to show:
if appnext.adIsLoaded( appNextInterAppKey ) then appnext.showAd( appNextInterAppKey ) end