Legacy Documentation: Version 4.6(go to latest)
Language: English
  • C#
  • JS
  • Boo

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

ADBannerView

Namespace: UnityEngine

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

ADBannerView is a wrapper around the ADBannerView class found in the Apple iAd framework and is only available on iOS.

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

private ADBannerView banner = null;

void Start() { banner = new ADBannerView(ADBannerView.Type.Banner, ADBannerView.Layout.Top); ADBannerView.onBannerWasClicked += OnBannerClicked; ADBannerView.onBannerWasLoaded += OnBannerLoaded; }

void OnBannerClicked() { Debug.Log("Clicked!\n"); }

void OnBannerLoaded() { Debug.Log("Loaded!\n"); banner.visible = true; }

Variables

layout Banner layout.
loaded Checks if banner contents are loaded.
position The position of the banner view.
size The size of the banner view.
visible Banner visibility. Initially banner is not visible.

Constructors

ADBannerView Creates a banner view with given type and auto-layout params.

Static Functions

IsAvailable Checks if the banner type is available (e.g. MediumRect is available only starting with ios6).