×
A new build of Corona SDK is now available to subscribers. Not a subscriber? Subscribe now.
CoronaSDK 2012.821 | Released: 23 May 2012, 2:01am | What's New | Download Now

Ads (inneractive)

Ads API

The following line makes Ad features available under the "ads" namespace:

ads = require "ads"

ads.init( providerName, appId [, listener] )
The above line is required to initialize the banner ads library for further use in your app. providerName is a string representing the ad network you wish to use (e.g. "inneractive"). appId is your unique app Id you'll get from the network's website for use with your app. The third argument is optional, and is used to specify a function that will be called whenever an ad is displayed.

ads.show( adUnitType [, params] )
The ads.show() function is used to display an actual advertisement. There are currently three different ad unit types you can show for the "inneractive" network:

  • "banner"
  • "fullscreen"
  • "text"

params

This argument is optional, and is used to set some initial settings for the ad unit. Below is a listing of the different parameters you can pass:

x - number. the starting x-coordinate of the banner unit (from top-left reference point).

y - number. the starting y-coordinate of the banner unit (from top-left reference point).

interval - number. the amount of seconds you want each ad to show before switching to the next.

ads.hide()
Hides all ads that are currently showing.

Usage Example:

local ads = require "ads"
 
-- Example for inneractive:
ads.init( "inneractive", "IA_GameTest" )
 
-- iPhone, iPod touch, iPad, android etc
ads.show( "banner", { x=0, y=0, interval=60 } )
ads.show( "fullscreen", { x=0, y=0, interval=60 } )
ads.show( "text", { x=0, y=100, interval=60 } )
 
-- hide all ads
ads.hide()

Refer to the guide below for steps on how to get a unique inneractive appId for your project (each app must have its own unique appId).

Signing up with Inneractive

STEP ONE

Visit the inneractive registration page to get a new account. Click 'Join Us, It's FREE!', and then fill out the short registration form (screenshots below):

inneractive Signup Step 1

inneractive Signup Step 2

STEP TWO

Once you fill out the form and click 'Get Started Now', you should be presented with the following message:

inneractive Signup Step 3

Check your email (the one you used to fill out the form) and click the confirmation link when you receive the email from "inneractive".

Once you click the link, you'll receive another email that contains your auto-generated password.

STEP THREE

The link you clicked (from the email) should bring you to the 'Add App' section where you can create an AppID for your app. If not, login with your username/password, and click the 'Add App' tab at the top.

Fill out the form (shown below) with your app details and click 'Create'.

inneractive Signup Step 4

In a few seconds, you AppID will be shown. You should pass this as the second argument to ads.init() (make sure to put it in quotes).

inneractive Signup Step 5

Your AppID should be ready for use as soon as you get it.