What is the proper way to implement KIDOZ ad when using composer for scene management?

So this is what I did:

In my build.settings file, I added this:

-- Plugins section -- plugins = { ["plugin.kidoz"] = { publisherId = "com.coronalabs" }, },

And this is what I added to my main.lua:

I declared variable kidoz as global.

kidoz = require( "plugin.kidoz" ) function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization print( event.provider ) end end -- Initialize the KIDOZ plugin kidoz.init( adListener, { publisherID="#####", securityToken="abcdefghigklmnop" } )

(publisherID and securityToken concealed for some good reasons…)

And this in the scene:create function of the scene I want the ad to be displayed:

kidoz.load( "interstitial" )

And added this code in the “did” phase of the scene:show function of the scene I want the ad to be displayed:

kidoz.show( "interstitial" )

And this in the “did” phase of the scene:hide function:

kidoz.hide( "interstitial" )

__________________________________________

So that’s what I did.

When run on pc, the console says:

kidoz.init() WARNING: The KIDOZ plugin is only supported on Android & iOS devices. Please build for device

kidoz.load() WARNING: The KIDOZ plugin is only supported on Android & iOS devices. Please build for device

kidoz.show() WARNING: The KIDOZ plugin is only supported on Android & iOS devices. Please build for device

So I built for android, and got it into my phone that runs the latest version of android, android pie.

The game works fine. But the ad doesn’t show up. Waited 10 mins on the scene. Still no response.

Help…

You will never see ads on the Corona simulator because the plugins are for mobile devices only.

You must put code in your .init()'s listener function to print the values of the event table if you’re to see any errors from the upstream ad provider. It’s the only way you can get information about what’s going on. You will need to be able to view your device’s console messages. Most people will do this with a tool named “adb” (you can Google it) or you might be able to with Android Studio with your device plugged in to your development computer via it’s USB cable.

For ads in general, this tutorial is useful:

http://docs.coronalabs.com/tutorial/basics/ads/index.html

Rob

You will never see ads on the Corona simulator because the plugins are for mobile devices only.

You must put code in your .init()'s listener function to print the values of the event table if you’re to see any errors from the upstream ad provider. It’s the only way you can get information about what’s going on. You will need to be able to view your device’s console messages. Most people will do this with a tool named “adb” (you can Google it) or you might be able to with Android Studio with your device plugged in to your development computer via it’s USB cable.

For ads in general, this tutorial is useful:

http://docs.coronalabs.com/tutorial/basics/ads/index.html

Rob