Banners
Adobe Air Banners ad unit
Before you begin!
Make sure that you have completed the Adobe Air Plugin installation before you begin integrating the Banners ad unit
Integrating the Banners ad unit
Step 1: Set the banner
var banner:Banner = new Banner("YOUR_APPNEXT_PLACEMENT_ID");
banner.setBannerSize(Banner.SIZE_BANNER);
banner.setPosition(Banner.POSITION_CENTER | Banner.POSITION_BOTTOM);
banner.addEventListener(AdEvent.AD_LOADED, adLoadedHandler);
banner.loadAd();
function adLoadedHandler(event: Event): void {
banner.show();
}
Step 2: Configure the BannerAdRequest (Optional)
By default, the banner settings will be loaded with pre-defined settings. You can change these settings by defining the BannerAdRequest
object
Setters that are relevant to all banner sizes:
setCategories
- String. Set preferred ad categoriessetPostback
- String. Postback parameters that will be posted to your server after user installed an app (make sure to encode the values)
Setters that are relevant only to the MEDIUM_RECTANGLE
banner size:
setCreativeType
- TheMEDIUM_RECTANGLE
size can show video in addition to static creative. When video is in use, the file will be streamed (default value isALL
- managed by Appnext)BannerAdRequest.TYPE_ALL
BannerAdRequest.TYPE_VIDEO
- `BannerAdRequest.TYPE_STATIC*
setAutoPlay
- Boolean. When a video is set in the creative, this setter defining if the video will autoplay or not (default value is false)setMute
- Boolean. When a video is set in the creative, this setter is defining if the video will start on muted volume or not. Un-mute/Mute button is located in the video creative. (default value is true - video is muted)setVideoLength
- When a video is set in the creative, this setter is defining the preferred length of the video. (default value is SHORT)BannerAdRequest.VIDEO_LENGTH_SHORT
- Up to 15 seconds long videosBannerAdRequest.VIDEO_LENGTH_LONG
- 20-60 seconds long videos
// All sizes example
BannerAdRequest banner_request = new BannerAdRequest();
banner_request
.setCategories("category1, category2")
.setPostback("Postback string");
// ...
banner.loadAd(banner_request);
// MEDIUM_RECTANGLE size example
BannerAdRequest banner_request = new BannerAdRequest();
banner
.setCategories("category1, category2")
.setPostback("Postback string")
.setCreativeType(BannerAdRequest.TYPE_VIDEO)
.setAutoPlay(true)
.setMute(false)
.setVideoLength(BannerAdRequest.VIDEO_LENGTH_SHORT);
// ...
Step 3: Banner Events
AdEvent.AD_LOADED
- The banner was successfully loaded, and itβs ready to be shown to the userAdEvent.AD_IMPRESSION
- The banner was viewed by the user, and an impression was reported to AppnextAdEvent.AD_CLICKED
- The banner was clicked by the userAdEvent.AD_ERROR
- An error has occurred
The following possible errors can be passed in the AdEvent.AD_ERROR handler:
NoInternetConnection;
NoPlacementID;
AdNotReady;
PreparingViews;
LoadingAd;
NoAds;
App Categories
1. Action 2. Adventure 3. Arcade 4. Arcade & Action 5. Board 6. Books & Reference 7. Brain & Puzzle 8. Business 9. Card 10. Cards & Casino 11. Casino 12. Casual 13. Comics 14. Communications 15. Education 16. Educational 17. Entertainment 18. Family 19. Finance 20. Health & Fitness 21. Libraries & Demo 22. Lifestyle 23. Live Wallpaper 24. Media & Video 25. Medical 26. Music 27. Music & Audio 28. News & Magazines | 29. Personalization 30. Photography 31. Productivity 32. Puzzle 33. Racing 34. Role Playing 35. Shopping 36. Simulation 37. Social 38. Sports 39. Sports Games 40. Strategy 41. Tools 42. Travel & Local 43. Trivia 44. Weather 45. Word |
Integration Support
Should you have any problems integrating the product, log a ticket with us by emailing [email protected].
Updated over 6 years ago