main.lua Help Using Appodeal Plugin for Banner Ad

Hi All,

I’m trying to put a banner ad in a game app using the Appodeal plugin.

Does my code look right in my main.lua?

Thanks for the help!

Neil

[lua]

– SDK Initialization

local appodeal = require( “plugin.appodeal” )

local function adListener( event )

    if ( event.phase == “init” ) then  – Successful initialization

        print( event.isError  )

    end

end

– Initialize the Appodeal plugin

appodeal.init( adListener, { appKey="",  disableWriteExternalPermissionCheck=true, supportedadTypes={“banner” } } )

– Banner Integration

appodeal.show( “banner”, { yAlign=“bottom” } )

[/lua]

I would put the show banner inside the init callback. Otherwise, without running it, It looks good. Also, it is probably not a good idea to share your id on a public forum. :slight_smile:

local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization appodeal.show( "banner", { yAlign="bottom" } ) end end

OK.  Thanks!

Neil

When do you want to show the banner ad? As soon as possible? Only on your menu screen? Only during gameplay?

Rob

I would try “as soon as possible” first, see what that looks like, then go from there.

Neil

Then @agramonte’s advice will be the quickest route to get an ad on the screen.

Rob

Good to know - thanks!

Neil

I would put the show banner inside the init callback. Otherwise, without running it, It looks good. Also, it is probably not a good idea to share your id on a public forum. :slight_smile:

local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization appodeal.show( "banner", { yAlign="bottom" } ) end end

OK.  Thanks!

Neil

When do you want to show the banner ad? As soon as possible? Only on your menu screen? Only during gameplay?

Rob

I would try “as soon as possible” first, see what that looks like, then go from there.

Neil

Then @agramonte’s advice will be the quickest route to get an ad on the screen.

Rob

Good to know - thanks!

Neil