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

Banner Ads

Introduction

Banner ads refer to a standard advertising format that occupies a designated space within an app's layout, usually positioned either at the top or bottom of the device screen.

[Important Note]: At present, Pangle supports only two specific banner ad sizes for traffic outside of the Chinese Mainland, namely 300x250(dp) and 320x50(dp). It is crucial to ensure that the banner ad placement and size comply with Pangle's specific requirements to ensure optimal ad performance and user experience.

Precondition

Create an app and banner ad placement on the 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 in 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.