Generally speaking with any ad provider, you will in:
build.settings: Include the plugin code inside the settings.plugin table:
settings = { plugins = { ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, }, }
This is added to your existing settings table. If you already have a plugins sub-table in your settings table, then you just add the plugin code itself.
Next in main.lua:
-
Require the plugin at the top of the file.
-
Somewhere before you go to your first scene, include the listener function and then call the .init() method.
Finally in whatever scene you want to show ads in:
-
require the plugin at the top of the scene.
-
Call the .show() method to show the ad.
Depending on your app’s flow and the ad provider you chose, you might want to pre-load the next ad some time before you actually want to show it.
This basic workflow works for all of our monetization plugins. AdMob is our oldest plugin. It’s limited to banners and interstitial ads. We have many other ad providers to choose from and you might find higher and better payouts with our other providers.
Rob