Pangle: A global platform dedicated to developer growth.|Integration Docs
Knowledge Center

Banner Ads

Introduction

Banner ads occupy a spot within an app's layout, either at the top or bottom of the device screen.

Note: Pangle only supports 300x250(point) and 320x50(point) for the traffic outside of Chinese Mainland at this time.

Precondition

Create an app and banner ad placement on Pangle platform

Banner Ads Implementation

The main steps to integrate banner ads are:

  1. Create PAGBannerRequest object
  1. Load the banner ad, set the rootViewController in the completionHandler callback
  1. set the ad delegate object that follows the PAGBannerAdDelegate and get the bannerView
  1. Display the ad.

Load a banner ad

Loading an ad is accomplished using the + (void)loadAdWithSlotID:request: completionHandler:() method on the PAGBannerAd class. The method requires an ad slot id, instance objects of PAGBannerRequest and a block. In the block, please set the rootViewController, set the ad delegate of PAGBannerAdDelegate and get the bannerView. After getting bannerView, choose the right time to add bannerView to your own view.

Create PAGBannerRequest object

Load a banner ad and set PAGBannerAdDelegate

Register PAGBannerAdDelegate callback

The description of PAGBannerAdDelegate callback

PAGBannerAdDelegate

description

- (void)adDidShow:(PAGBannerAd *)ad

This method is invoked when the ad is displayed, covering the device's screen.

- (void)adDidClick:(PAGBannerAd *)ad

This method is invoked when the ad is clicked by the user.

- (void)adDidDismiss:(PAGBannerAd *)ad

This method is invoked when the ad disappears.

Display the Ad

Test with test ads

Now you have finished the integration. If you wanna test your apps, make sure you use test ads rather than live, production ads. The easiest way to load test ads is to use test mode. It's been specially configured to return test ads for every request, and you're free to use it in your own apps while coding, testing, and debugging.

Refer to the How to add a test device? to add your device to the test devices on Pangle platform.