Legacy Documentation: Version 5.5
LanguageEnglish
  • C#
  • JS

Script language

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

Removed in version 5.5.2p4

ADBannerView

class in UnityEngine.iOS

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

Submission failed

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

Close

Cancel

Obsolete
Obsolete

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.

#pragma strict
public class NewBehaviourScript extends MonoBehaviour {
	private var banner: iOS.ADBannerView = null;
	function Start() {
		banner = new iOS.ADBannerView(iOS.ADBannerView.Type.Banner, iOS.ADBannerView.Layout.Top);
		iOS.ADBannerView.onBannerWasClicked += OnBannerClicked;
		iOS.ADBannerView.onBannerWasLoaded += OnBannerLoaded;
		iOS.ADBannerView.onBannerFailedToLoad += OnBannerFailedToLoad;
	}
	function OnBannerClicked() {
		Debug.Log("Clicked!\n");
	}
	function OnBannerLoaded() {
		Debug.Log("Loaded!\n");
		banner.visible = true;
	}
	function OnBannerFailedToLoad() {
		Debug.Log("FAIL!\n");
		banner.visible = false;
	}
}
using UnityEngine;
using System.Collections;

using ADBannerView = UnityEngine.iOS.ADBannerView;

public class NewBehaviourScript : MonoBehaviour {

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

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

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

void OnBannerFailedToLoad() { Debug.Log("FAIL!\n"); banner.visible = false; } }