Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Smaato for Amazon.
Started by agramonte Jan 07 2018 08:14 PM

1 reply to this topic
smaato amazon
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Contributor

  • 677 posts
  • Corona SDK

I have created a simple plugin for Smaato/Amazon. 

To sign up for smaato: https://www.smaato.com/

 

Some notes before I get started:

1. 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.

2. 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.

3. 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. 

4. If you send 0 for all your Ids you will get test ads.

5. All the parts to make this work and the sample app is up on github. https://github.com/agramonte/smaato-corona-plugin

6. 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.

 

1. Load the plugin.

local smaato = require "plugin.smaato"

2. Initialize it:

smaato.init( 
	somoListerner, -- Listerner for events.
	{ pubId = 0} -- Pub Id from smaato control panel.
)

3. In the init response load/show the ads you want.

 

4. 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.
		}
		)

5. Interstitial load.

smaato.load( "interstitial", -- interstitial have to be loaded first.
		{
			 adSpaceId = 0 -- ad space id from smaato.
		}
		)

6. Check interstitial is loaded before showing:

if smaato.isLoaded( "interstitial" ) then
		smaato.show("interstitial")
end

7. 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)
}


[TOPIC: post.html]
#2

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Contributor

  • 677 posts
  • Corona SDK

A few changes recently added:

1. I tried making all the events match the Admob plugin.

2. Banner ads are now fully functional and working great.

 

Only problem:

Some interstitial ads display as a white screen. I opened up a ticket with Smaato. Hopefully, they'll get back to me soon and I'll be able to publish this plugin for Amazon.




[topic_controls]
[/topic_controls]