Package | com.vungle.extensions |
Class | public class Vungle |
Inheritance | Vungle ![]() |
Property | Defined By | ||
---|---|---|---|
vungle : Vungle [static] [read-only]
The current instance of the Vungle singelton. | Vungle |
Method | Defined By | ||
---|---|---|---|
Vungle(appId:String, placements:Array, logCallback:Function, endpoint:String) Do Not call this directly; use Vungle.create() or Vungle.vungle to get current instance. | Vungle | ||
[static]
Initializes the Vungle Extension. | Vungle | ||
getSdkVersion():String
Return the current version String of the internal iOS or Android Vungle SDK being used by the extension on this platform. | Vungle | ||
isAdAvailable(placement:String):Boolean
Checks whether the Vungle extension has an ad available to be
played. | Vungle | ||
isInitialized():Boolean
Checks if the SDK is initialized. | Vungle | ||
loadAd(placement:String):void
Prepares a placement when you know that you will want
to show an ad experience tied to a specific placement ID. | Vungle | ||
playAd(placement:String, adConfig:VungleAdConfig = null):void
When your app has reached a suitable stopping point, you call this method
to display a video ad. | Vungle | ||
setLoggingEnabled(enable:Boolean):void
On iOS, sets whether the internal SDK logging is enabled. | Vungle |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when it is unable to play the ad. | Vungle | |||
Dispatched when an ad has been dismissed. | Vungle | |||
Dispatched when Vungle SDK has finished initialization. | Vungle | |||
Dispatched when a log message is sent by the plugin (iOS only). | Vungle | |||
Dispatched when the SDK has an ad ready to be displayed or when, for some reason, there's no ad available. | Vungle | |||
Dispatched when an ad has started. | Vungle |
Constant | Defined By | ||
---|---|---|---|
VERSION : String = 5.3.0 [static] Version | Vungle |
vungle | property |
vungle:Vungle
[read-only]
The current instance of the Vungle
singelton. You must call Vungle.create()
before this property is available.
public static function get vungle():Vungle
Error — if Vungle.create() was not called before first accessing this property.
|
Vungle | () | Constructor |
public function Vungle(appId:String, placements:Array, logCallback:Function, endpoint:String)
Do Not call this directly; use Vungle.create() or Vungle.vungle to get current instance.
ParametersappId:String | |
placements:Array | |
logCallback:Function | |
endpoint:String |
create | () | method |
public static function create(appId:String, placements:Array, logCallback:Function = null, endpoint:String = null):Vungle
Initializes the Vungle Extension.
Vungle is a Singleton and you may have only one instance. After creation, you may access the instance through
the static property Vungle.vungle
.
Parameters
appId:String — The unique identifier for your app.
| |
placements:Array — An array of strings representing placements defined in the dashboard.
| |
logCallback:Function (default = null )
| |
endpoint:String (default = null )
|
Vungle — initialized instance of Vungle extension interface.
|
Error — if Vungle has already been initialized.
| |
Error — if Vungle is not supported on this platform
| |
ArgumentError — if appIds is not a valid array of 1-2 String IDs
|
getSdkVersion | () | method |
public function getSdkVersion():String
Return the current version String of the internal iOS or Android Vungle SDK being used by the extension on this platform.
ReturnsString — version String of the iOS or Android internal Vungle SDK being used on this platform
|
isAdAvailable | () | method |
public function isAdAvailable(placement:String):Boolean
Checks whether the Vungle extension has an ad available to be
played. When your app has reached a suitable stopping point, you
can ask the VunglePub SDK whether it has an ad ready to be
displayed using this method. If it returns true
,
then at least one ad has been completely downloaded to disk and is
ready to display. If it returns false
, there are no
video ads to dsiplay at this time.
Parameters
placement:String — The placement defined on the Vungle dashboard.
|
Boolean — true if an ad has been downloaded and is ready to play. False otherwise.
|
isInitialized | () | method |
public function isInitialized():Boolean
Checks if the SDK is initialized.
ReturnsBoolean — true if SDK has finished initialization, false otherwise.
|
loadAd | () | method |
public function loadAd(placement:String):void
Prepares a placement when you know that you will want to show an ad experience tied to a specific placement ID.
Parameters
placement:String — The placement defined on the Vungle dashboard.
|
playAd | () | method |
public function playAd(placement:String, adConfig:VungleAdConfig = null):void
When your app has reached a suitable stopping point, you call this method
to display a video ad. You should check isAdAvailable()
first
to determine if an ad has been downloaded and is available for play.
Parameters
placement:String — The placement defined on the Vungle dashboard.
| |
adConfig:VungleAdConfig (default = null ) — configuration object. If not specified then the
global configuration will be used.
|
setLoggingEnabled | () | method |
public function setLoggingEnabled(enable:Boolean):void
On iOS, sets whether the internal SDK logging is enabled.
Enable logging and listen for VungleEvent.AD_LOG
if you need more debug info. Has no effect on Android.
Parameters
enable:Boolean — whether to enable logging
|
See also
AD_FAILED | Event |
com.vungle.extensions.events.VungleEvent
com.vungle.extensions.events.VungleEvent.AD_FAILED
Dispatched when it is unable to play the ad.
AD_FINISHED | Event |
com.vungle.extensions.events.VungleEvent
com.vungle.extensions.events.VungleEvent.AD_FINISHED
Dispatched when an ad has been dismissed.
AD_INIT | Event |
com.vungle.extensions.events.VungleEvent
com.vungle.extensions.events.VungleEvent.AD_INIT
Dispatched when Vungle SDK has finished initialization.
AD_LOG | Event |
com.vungle.extensions.events.VungleEvent
com.vungle.extensions.events.VungleEvent.AD_LOG
Dispatched when a log message is sent by the plugin (iOS only).
AD_PLAYABLE | Event |
com.vungle.extensions.events.VungleEvent
com.vungle.extensions.events.VungleEvent.AD_PLAYABLE
Dispatched when the SDK has an ad ready to be displayed or when, for some reason, there's no ad available.
AD_STARTED | Event |
com.vungle.extensions.events.VungleEvent
com.vungle.extensions.events.VungleEvent.AD_STARTED
Dispatched when an ad has started.
VERSION | Constant |
public static const VERSION:String = 5.3.0
Version