Skip to content
This repository was archived by the owner on Nov 7, 2023. It is now read-only.
Dominic Roberts edited this page Dec 4, 2017 · 7 revisions

Banner

Contents

Banner ads are added as a subview inside your application. Consumers of your app can tap the banner ad to interact with it.

Banner Sizes

Banner Size Google Ad Mob Facebook Audience Network
STANDARD 320x50 320x50
LARGE 320x100 320x90
MEDIUM_RECT 300x250 300x250
FULL 468x60 N/A
LEADERBOARD 728x90 N/A
SMART various N/A

NOTE: Not all banner sizes are available for all networks, if an ad size is unavailable for the registered Adapters, no ad will be shown.

1. Load the banner

First you need to set up event listeners for banner events you are interesting in:

Banner.getInstance().addEventListener(TapdaqEvent.DID_LOAD,onTapdaqEvent);
Banner.getInstance().addEventListener(TapdaqEvent.DID_FAIL_LOAD,onTapdaqEvent);
Banner.getInstance().addEventListener(TapdaqEvent.DID_CLOSE,onTapdaqEvent);
Banner.getInstance().addEventListener(TapdaqEvent.DID_CLICK,onTapdaqEvent);
Banner.getInstance().addEventListener(TapdaqEvent.DID_REFRESH,onTapdaqEvent);

Before displaying we have to load the banner:

Banner.getInstance().load(Banner.SIZE_STANDARD);

2. Display the banner

After banner is loaded we can display it. There are 2 different positions to show banners - at top and bottom of the screen. Depends on banner size it will automatically aligned.

Banner.getInstance().show(Banner.POSITION_TOP);

3. Refresh Banner Event

After the Banner is shown you can lister for refresh event. This event is generated every 30 seconds on each banner refresh.

Banner.getInstance().addEventListener(TapdaqEvent.DID_REFRESH,onTapdaqEvent);

private function onAdEvent(event:TapdaqEvent):void {
  trace("Banner is refreshed!");
}

4. Destroy the banner

To hide the banner just call the hide() function:

Banner.getInstance().hide();

Need help?

If you are having any problems integrating, feel free to contact us on support@tapdaq.com and we will be more than happy to help.

What's next?

Now that you have successfully integrated a banner into your app, what would you like to do next?

Clone this wiki locally