Packagecom.myflashlab.air.extensions.admob
Classpublic class AdMob
InheritanceAdMob Inheritance Object

This is the entry point for using the Admob SDK in your app.



Public Properties
 PropertyDefined By
  api : AdMobApi
[static] [read-only] Access to the Admob API
AdMob
Public Methods
 MethodDefined By
  
dispose():void
[static] Call this method if you wish to dispose all current Ad types.
AdMob
  
init($stage:Stage, $applicationCode:String = null):AdMob
[static] This is the first method you should call when using the Admob ANE.
AdMob
Public Constants
 ConstantDefined By
  AD_TYPE_BANNER : String = banner
[static]
AdMob
  AD_TYPE_INTERSTITIAL : String = interstitial
[static]
AdMob
  AD_TYPE_REWARDED_VIDEO : String = rewardedVideo
[static]
AdMob
  ANDROID_SDK_VERSION : String = 18.3.0
[static]
AdMob
  ERROR_CODE_INTERNAL_ERROR : int = 0
[static] Something happened internally; for instance, an invalid response was received from the ad server.
AdMob
  ERROR_CODE_INVALID_REQUEST : int = 1
[static] The ad request was invalid; for instance, the ad unit ID was incorrect.
AdMob
  ERROR_CODE_NETWORK_ERROR : int = 2
[static] The ad request was unsuccessful due to network connectivity.
AdMob
  ERROR_CODE_NO_FILL : int = 3
[static] The ad request was successful, but no ad was returned due to lack of ad inventory.
AdMob
  EXTENSION_ID : String = com.myflashlab.air.extensions.admob
[static]
AdMob
  IOS_SDK_VERSION : String = 7.55.1
[static]
AdMob
  VERSION : String = 5.10.0
[static]
AdMob
Property Detail
apiproperty
api:AdMobApi  [read-only]

Access to the Admob API


Implementation
    public static function get api():AdMobApi
Method Detail
dispose()method
public static function dispose():void

Call this method if you wish to dispose all current Ad types. Alternatively you can call each Ad type's dispose method to speceficly dispose it.

See also

init()method 
public static function init($stage:Stage, $applicationCode:String = null):AdMob

This is the first method you should call when using the Admob ANE. You only need to call this method only once.

IMPORTANT: When initializing the ANE, you are required to pass in the flash.display.Stage into the ANE, but you should be careful when you are doing this. When your app starts on iOS platform, the AIR Stage will need a couple of seconds before it can reach its final dimension. So if you are initializing the ANE too soon on iOS, it's very probable that you can't correctly control the x, y position of banner ads. All you have to do is to wait a few seconds from the launch time of your app and then initialize the Admob ANE.

Parameters

$stage:Stageflash.display.Stage of your AIR project
 
$applicationCode:String (default = null) — pass null to use the DoubleClick API but if you want to use the Admob API, you must copy your Admob application code here. When you create a new app in your Admob console https://apps.admob.com you will receive an App ID String which is something like this: ca-app-pub-9202431023205722~4891265119. You should copy that String here.

Returns
AdMob
Constant Detail
AD_TYPE_BANNERConstant
public static const AD_TYPE_BANNER:String = banner

AD_TYPE_INTERSTITIALConstant 
public static const AD_TYPE_INTERSTITIAL:String = interstitial

AD_TYPE_REWARDED_VIDEOConstant 
public static const AD_TYPE_REWARDED_VIDEO:String = rewardedVideo

ANDROID_SDK_VERSIONConstant 
public static const ANDROID_SDK_VERSION:String = 18.3.0

ERROR_CODE_INTERNAL_ERRORConstant 
public static const ERROR_CODE_INTERNAL_ERROR:int = 0

Something happened internally; for instance, an invalid response was received from the ad server.

ERROR_CODE_INVALID_REQUESTConstant 
public static const ERROR_CODE_INVALID_REQUEST:int = 1

The ad request was invalid; for instance, the ad unit ID was incorrect.

ERROR_CODE_NETWORK_ERRORConstant 
public static const ERROR_CODE_NETWORK_ERROR:int = 2

The ad request was unsuccessful due to network connectivity.

ERROR_CODE_NO_FILLConstant 
public static const ERROR_CODE_NO_FILL:int = 3

The ad request was successful, but no ad was returned due to lack of ad inventory.

EXTENSION_IDConstant 
public static const EXTENSION_ID:String = com.myflashlab.air.extensions.admob

IOS_SDK_VERSIONConstant 
public static const IOS_SDK_VERSION:String = 7.55.1

VERSIONConstant 
public static const VERSION:String = 5.10.0