ADBannerView

ADBannerView is a wrapper around the ADBannerView class found in the Apple iAd framework and is only available on iPhone/iPad/iPod Touch.

It provides a view that displays banner advertisements to the user.

private var banner : ADBannerView = null;

function ShowBanner() {
while (!banner.loaded && banner.error == null)
yield;

if (banner.error == null)
banner.Show();
else banner = null;
}
function OnGUI() {
GUI.enabled = (banner == null ? true : false);

if (GUILayout.Button("Show Banner")) {
banner = new ADBannerView();
banner.autoSize = true;
banner.autoPosition = ADPosition.Bottom;
StartCoroutine(ShowBanner());
}
}

Variables
requiredSizeIdentifiers

Identifiers for the sizes of advertisements that the banner view can display.

currentSizeIdentifier

The current size of the advertisement displayed in the banner view.

autoSize

If enabled, current banner's size is set automatically according to current screen orientation. It is disabled by default.

position

The position of the banner view.

autoPosition

Enables the banner view to be positioned automatically.

visible

Is the banner view visible? (Read Only)

loaded

Has the banner view downloaded an advertisement? (Read Only)

actionInProgress

Is the banner currently executing a user-triggered action? (Read Only)

error

An advertisement error. (Read Only)

Constructors
ADBannerView

Creates a banner view.

Functions
Show

Shows the banner view.

Hide

Hides the banner view.

CancelAction

Cancels an executing banner view action.

Class Functions
GetSizeFromSizeIdentifier

Converts a banner content size identifier into its physical size.