Skip to main content
Interstitial ads are full-screen ads that cover the interface of the app. They’re typically displayed at natural transition points in the flow of the app.

Initialising an ad

Start by creating an instance of CIInterstitialAd with the following parameters. Create one instance per ad you intend to show.

Required

  • placementId: string: Unique ID for this Ad Placement provided by Content Ignite.

Optional

  • pageUrl: string: URL used for targeting, for example if the ad is displayed in a section of the app which has an equivalent URL on the web.
  • targeting: Record<string, string[]>: Pass custom key-value pairs to ad requests.
  • eventListener: CIInterstitialEventListener: Respond to load and dismiss events. See Handling ad events.

Load the ad

When you are ready to load the ad, call load(). It resolves to true when an ad is ready and false if loading failed:

Show the ad

When you are ready to display the ad, such as after a transition in the app flow, call show(). Like load(), it resolves to a boolean: true once the ad has been shown and dismissed, or false immediately if no ad was loaded:
To show another ad after one is dismissed, call load() again to prepare a fresh ad.

Handling ad events

To listen and respond to events from an Interstitial ad, pass a CIInterstitialEventListener when creating the ad. All callbacks are optional, so provide only the ones you need:
The listener is complementary to the promises returned by load() and show() — use whichever style suits your app. The events map to the same signals:

Releasing the ad

Call destroy() to release the native ad, stop listening for events, and free resources — for example when the component that owns the ad unmounts:
See the full example: Interstitial sample app.