I have created a simple plugin for Smaato/Amazon.
To sign up for smaato: https://www.smaato.com/
Some notes before I get started:
-
It will only work on non-Play store downloaded apps. If the app comes from google play store it will just show test ads. There are plenty of options for iOS and Google.
-
Currently only available for native builds. I plan to finish it up soon (within a couple of weeks) and put it up on the market if it is blessed by Corona.
-
It doesn’t include any adapters, but you can use sdk-less adapters. So far I have tested the following sdk-less adapters AOL, TapIt, and Mobfox.
-
If you send 0 for all your Ids you will get test ads.
-
All the parts to make this work and the sample app is up on github. https://github.com/agramonte/smaato-corona-plugin
-
I am not in any way associated or being paid by Smaato or Corona. In the event that either party request that I remove this plugin, It will be removed.
And as usual, I hope somebody finds it useful.
How it works.
-
Load the plugin.
local smaato = require “plugin.smaato”
-
Initialize it:
smaato.init( somoListerner, – Listerner for events. { pubId = 0} – Pub Id from smaato control panel. )
-
In the init response load/show the ads you want.
-
Banner load and show. Banner will show as soon as loaded.
smaato.show( “banner”, – Ad type. { adSpaceId = 0, – Ad spaceid from Smaato. y=“bottom”, – Postion of banner. Top and bottom currently support. autoRefresh=true, – Should the banner auto-refresh. refreshInterval=45 – Time in seconds before refresh. } )
-
Interstitial load.
smaato.load( “interstitial”, – interstitial have to be loaded first. { adSpaceId = 0 – ad space id from smaato. } )
-
Check interstitial is loaded before showing:
if smaato.isLoaded( “interstitial” ) then smaato.show(“interstitial”) end
-
Hiding the banner ad:
smaato.hide(“banner”)
What the events look like:
{ "name":"adsRequest", -- Always adsRequest. "phase":"init", -- Currently can be: init/loaded/displayed/hidden/hide/load/show "provider":"smaato", -- Always smaato "response":"", -- On error or warning. Description displayed here. "type":"", -- banner/interstitial. "isError":false -- false/true. Even with an error it will try and show ads by defaulting to internal values (Example: testAds, banner on bottom) }