Ads Interface

Status: Stable

Version: 1.7

Supported platforms:


Documentation Forum thread

What's new?

version 1.7
(IOS and Android)Revmob - upgraded sdk
(IOS and Android)Applovin - implemented sdk
(IOS)Amazon- implemented sdk
(Android)Admob - removed check for Google Play services

About Ads Interface

The idea is to provide common Ads interface for most of available ad frameworks, so that user's would not have to create a plugin for each of them separately, but rather it would be possible to wrap ad framework in single Java or Objective-C class (depending on the platform) and add it to the project, without even recompiling existing Ads Interface plugin.

Additionally it would be able to support multiple ad frameworks simultaneously so users could switch and fall back between ad frameworks on runtime.

So the benefits would be:
Using same interface not only across platforms, but also across ad frameworks
Providing ability to use multiple ad frameworks simultaneously
Making it easier to add new ad frameworks only by wrapping its functionality in Native interface



Copy libs folder into your exported project
Copy src folder into your exported project
Copy res folder into your exported project
Add System.loadLibrary("ads"); to your main activity
Add "" as external class in your main activity
You must install each ad framework you want to use based on their instalation instructions (usually adding .jar file to project and modifying AndroidManifest file)


Copy contents of Plugins directory into your exported project's Plugins directory
Add copied files to your Xcode project (Check create groups for added folders)

Code example:

require "ads"
admob ="admob")
admob:setAlignment("center", "bottom")

admob:addEventListener(Event.AD_RECEIVED, function()
	print("Admob AD_RECEIVED")

admob:addEventListener(Event.AD_FAILED, function(e)
	print("Admob AD_FAILED", e.error)

admob:addEventListener(Event.AD_ACTION_BEGIN, function()
	print("Admob AD_ACTION_BEGIN")

admob:addEventListener(Event.AD_ACTION_END, function()
	print("Admob AD_ACTION_END")

admob:addEventListener(Event.AD_DISMISSED, function()
	print("Admob AD_DISMISSED")

admob:addEventListener(Event.AD_ERROR, function(e)
	print("Admob AD_ERROR", e.error)