Coding Guidelines

Make sure you read the iAd Setup section first.

With iAd, you can use two types of ad interstitial and banners.

1. Interstitial

There are two ways to use interstitial.

iAdBannerController.instance.StartInterstitialAd ();

Will start Ad load request and as soon the ad loaded will show the interstitial ad.

Or you can use the load method. It will start Ad load request,  but  it will not show the ad after it done loading. So you can use show method to show it immediately.

Here is an example if such implementation:

iAdBannerController.instance.InterstitialAdDidLoadAction += InterstitialAdDidLoadAction;
iAdBannerController.instance.LoadInterstitialAd ();

private void InterstitialAdDidLoadAction () {
		//unsubscribing from event
		iAdBannerController.instance.InterstitialAdDidLoadAction -= InterstitialAdDidLoadAction;

		//the ad content is loaded, now we can use ShowInterstitialAd, to show it imidiatly any time we need.
		iAdBannerController.instance.ShowInterstitialAd ();

Note: Loaded as can be showed only once, so we need to load new ad again after show is complete.

Here is full action list you can use with interstitial ad.

public Action InterstitialDidFailWithErrorAction = delegate {};
public Action InterstitialAdWillLoadAction = delegate {};
public Action InterstitialAdDidLoadAction = delegate {};
public Action InterstitialAdDidFinishAction	= delegate {};


You should use one of those approaches every time you want to show the interstitial ad.

When interstitial ad appears it will look similar to picture bellow:

2. Banners

Plugin iAd API gives ability to manage multiple banners at the time. That's why we need to create iAdBanner object, when we want to show the banner.

There is tow ways how we can create the banner.

1) With custom position

iAdBanner banner1 = iAdBannerController.instance.CreateAdBanner(300, 100);

2) With TextAnchor (most popular)

iAdBanner banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.UpperLeft);


Wen banner content will be loaded, it will appear on the screen. If you want to prevent banner appearing on the screen right after content is loaded, you ma use this flag:

iAdBanner banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.UpperLeft);
banner1.ShowOnLoad = false;

Here is full action list you can use the banner ad:

public Action AdLoadedAction = delegate {};
public Action FailToReceiveAdAction = delegate {};
public Action AdWiewLoadedAction = delegate {};
public Action AdViewActionBeginAction = delegate {};
public Action AdViewFinishedAction = delegate {};


iAdBanner public getters:

public int id 
public bool IsLoaded 
public bool IsOnScreen 
public bool ShowOnLoad 
public TextAnchor anchor 


iAdBanner methods

public void Hide()  
public void Show() 


You can also use iAdBannerController for getting banner by id:

public iAdBanner GetBanner(int id)


Getting Current banners list:

public List<iAdBanner> banners


Or destroying the banner

public void DestroyBanner(int id)


The banner ad will looks similar to picture bellow:

Sandbox Testing

If the ad is not appearing, it may depend from your device settings. If Want ad requests always be successful go to the:

Settings -> Developer -> Fill Rate

And set 100% always provide Ad. And if you want to test app behaviour when ad isn't appearing, use another fill rate.        


API Use example can be founded under the iAdUseExample.cs script