int AdBannerInit(int location);

 

Creates and displays an iAd banner at either the top or the bottom of the screen.

 

Return Value

 

Returns a non-zero value if the call was successful, zero if iAds are unsupported on the device.

 

Parameters

 

location

Specifies where the iAd should be displayed. Possible values are:

 

Location Value

Description

0

Top

1

Bottom

 

Remarks

 

AdBannerAd() adds an iAd banner to your application.  If the iAds feature is not supported on the target device, this call will return zero, and no ad will be displayed.  iAds are supported on iOS version 4.0 and higher.

 

IMPORTANT:  It is imperative to call AdBannerInit() AFTER you have created all other views.  Views created after AdBannerInit() is called may obscure your ad, potentially costing you ad revenue!

 

NOTE:  Only one instance of an iAd is permitted in an application.  Subsequent calls to AdBannerInit() will not create new iAd banners.  Use of iAds will require you to have your own Apple Developer Account configured for this service.  iAds are not available in every country, so make sure they are available wherever you plan to do business.

 

Availability

 

Available in DragonFireSDK 1.4 and later on devices running iOS 4.0 or later.

 

Example

 

#include "DragonFireSDK.h"

 

int HideButton;

int MoveButton;

 

int BannerLocation=0;

int BannerVisible=1;

 

int OnButton(int value)

{

  switch (value)

   {

      case 1:

          if (BannerVisible)

               BannerVisible = 0;

          else

               BannerVisible = 1;

           AdBannerSetVisible(BannerVisible);      

          break;

      case 2:

          if (BannerLocation)

               BannerLocation = 0;

          else

               BannerLocation = 1;

           AdBannerSetLocation(BannerLocation);

          break;

      default:

          break;

   }

  return(1);  

}

 

void AppMain()

{

   HideButton = ButtonAdd("Images/Hide", 10, 100, OnButton, 1);

   MoveButton = ButtonAdd("Images/Move", 10, 150, OnButton, 2);

   AdBannerInit(BannerLocation);

}

 

void OnTimer()

{

 

}

 

void AppExit()

{

 

}