ALInterstitialAd Class Reference

Inherits from NSObject
Declared in ALInterstitialAd.h

Overview

This class is used to display full-screen ads to the user.

Ad Delegates

  adLoadDelegate

An object conforming to the ALAdLoadDelegate protocol, which, if set, will be notified of ad load events.

@property (strong, atomic) id<ALAdLoadDelegate> __alnullable adLoadDelegate

Discussion

An object conforming to the ALAdLoadDelegate protocol, which, if set, will be notified of ad load events.

Declared In

ALInterstitialAd.h

  adDisplayDelegate

An object conforming to the ALAdDisplayDelegate protocol, which, if set, will be notified of ad show/hide events.

@property (strong, atomic) id<ALAdDisplayDelegate> __alnullable adDisplayDelegate

Discussion

An object conforming to the ALAdDisplayDelegate protocol, which, if set, will be notified of ad show/hide events.

Declared In

ALInterstitialAd.h

  adVideoPlaybackDelegate

An object conforming to the ALAdVideoPlaybackDelegate protocol, which, if set, will be notified of video start/finish events.

@property (strong, atomic) id<ALAdVideoPlaybackDelegate> __alnullable adVideoPlaybackDelegate

Discussion

An object conforming to the ALAdVideoPlaybackDelegate protocol, which, if set, will be notified of video start/finish events.

Declared In

ALInterstitialAd.h

Loading and Showing Ads, Class Methods

+ show

Show an interstitial over the application’s key window. This will load the next interstitial and display it.

+ (alnonnull ALInterstitialAd *)show

Discussion

Show an interstitial over the application’s key window. This will load the next interstitial and display it.

Note that this method is functionally equivalent to calling showOver: and passing [[UIApplication sharedApplication] keyWindow].

Declared In

ALInterstitialAd.h

+ showOver:

Show a new interstitial ad. This method will display an interstitial* over the given UIWindow.

+ (alnonnull ALInterstitialAd *)showOver:(alnonnull UIWindow *)window

Parameters

window

A window to show the interstitial over

Discussion

Show a new interstitial ad. This method will display an interstitial* over the given UIWindow.

Declared In

ALInterstitialAd.h

+ isReadyForDisplay

Check if an ad is currently ready to display.

+ (BOOL)isReadyForDisplay

Return Value

YES if a subsequent call to a show method will result in an immediate display. NO if a call to a show method will require network activity first.

Discussion

Check if an ad is currently ready to display.

Declared In

ALInterstitialAd.h

+ shared

Get a reference to the shared singleton instance.

+ (alnonnull ALInterstitialAd *)shared

Discussion

Get a reference to the shared singleton instance.

This method calls [ALSdk shared] which requires you to have an SDK key defined in Info.plist. If you use [ALSdk sharedWithKey: …] then you will need to use the instance methods instead.

Declared In

ALInterstitialAd.h

Loading and Showing Ads, Instance Methods

– show

Show an interstitial over the application’s key window. This will load the next interstitial and display it.

- (void)show

Discussion

Show an interstitial over the application’s key window. This will load the next interstitial and display it.

Note that this method is functionally equivalent to calling showOver: and passing [[UIApplication sharedApplication] keyWindow].

Declared In

ALInterstitialAd.h

– showOver:

Show an interstitial over a given window.

- (void)showOver:(alnonnull UIWindow *)window

Parameters

window

An instance of window to show the interstitial over.

Discussion

Show an interstitial over a given window.

Declared In

ALInterstitialAd.h

– showOver:andRender:

Show current interstitial over a given window and render a specified ad loaded by ALAdService.

- (void)showOver:(alnonnull UIWindow *)window andRender:(alnonnull ALAd *)ad

Parameters

window

An instance of window to show the interstitial over.

ad

The ad to render into this interstitial.

Discussion

Show current interstitial over a given window and render a specified ad loaded by ALAdService.

Declared In

ALInterstitialAd.h

  readyForDisplay

Check if an ad is currently ready to display.

@property (readonly, atomic, getter=isReadyForDisplay) BOOL readyForDisplay

Return Value

YES if a subsequent call to a show method will result in an immediate display. NO if a call to a show method will require network activity first.

Discussion

Check if an ad is currently ready to display.

Declared In

ALInterstitialAd.h

Dismissing Interstitials Expliticly

– dismiss

Dismiss this interstitial.

- (void)dismiss

Discussion

Dismiss this interstitial.

In general, this is not recommended as it negatively impacts click through rate.

Declared In

ALInterstitialAd.h

Initialization

– initWithSdk:

Init this interstitial ad with a custom SDK instance.

- (alnonnull instancetype)initWithSdk:(alnonnull ALSdk *)anSdk

Parameters

anSdk

Instance of AppLovin SDK to use.

Discussion

Init this interstitial ad with a custom SDK instance.

To simply display an interstitial, use [ALInterstitialAd showOver:window]

Declared In

ALInterstitialAd.h

– initWithFrame:sdk:

Init this interstitial ad with a custom SDK instance and frame.

- (alnonnull id)initWithFrame:(CGRect)aFrame sdk:(alnonnull ALSdk *)anSdk

Parameters

aFrame

Frame to use with the new interstitial.

anSdk

Instance of AppLovin SDK to use.

Discussion

Init this interstitial ad with a custom SDK instance and frame.

To simply display an interstitial, use [ALInterstitialAd showOver:window]. In general, setting a custom frame is not recommended, unless absolutely necessary. Interstitial ads are intended to be full-screen and may not look right if sized otherwise.

Declared In

ALInterstitialAd.h

Advanced Configuration

  frame

Frame to be passed through to the descendent UIView containing this interstitial.

@property (assign, nonatomic) CGRect frame

Discussion

Frame to be passed through to the descendent UIView containing this interstitial.

Note that this has no effect on video ads, as they are presented in their own view controller.

Declared In

ALInterstitialAd.h

  hidden

Hidden setting to be passed through to the descendent UIView containing this interstitial.

@property (assign, nonatomic) BOOL hidden

Discussion

Hidden setting to be passed through to the descendent UIView containing this interstitial.

Note that this has no effect on video ads, as they are presented in their own view controller.

Declared In

ALInterstitialAd.h