Type Function
Return value none
Revision Current Public Release (2017.3068)
Keywords ads, advertising, vungle
See also


ads.init() initializes the Corona ads library by specifying the name of the ad network service provider and the application identifier.

Once the ads library is initialized, you can request an ad using


ads.init( providerName, appId [, adListener] )
providerName (required)

String. String value for the provider name. For Vungle, use "vungle".

appId (required)

String. String containing the app ID.

adListener (optional)

Listener. The function or table that will handle ad lifecycle events from the Vungle plugin. Vungle notifies you of the following events:


name "adsRequest"
provider "vungle"
type "adStart"
isError false if an ad started playing; true if an ad could not be played
response reason why ad could not be played if isError is true


name "adsRequest"
provider "vungle"
type "adView"
isError false
totalAdSeconds the total length of the video in seconds
secondsWatched the length of the longest view by the user, in seconds
isCompletedView true if the user watched 80% of the video; false otherwise


name "adsRequest"
provider "vungle"
type "adEnd"
isError false
wasCallToActionClicked true if the user clicked on the call-to-action (usually "Download"); false otherwise


name "adsRequest"
provider "vungle"
type "cachedAdAvailable"
isError false