ALIncentivizedInterstitialAd Class Reference

Inherits from NSObject
Declared in ALIncentivizedInterstitialAd.h

Overview

This class is used to show rewarded videos to the user. These differ from regular interstitials in that they allow you to provide you user virtual currency in exchange for watching a video.

Ad Delegates

  adDisplayDelegate

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

@property (strong, nonatomic) 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

ALIncentivizedInterstitialAd.h

  adVideoPlaybackDelegate

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

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

Discussion

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

Declared In

ALIncentivizedInterstitialAd.h

Integration, Class Methods

+ shared

Get a reference to the shared instance of ALIncentivizedInterstitialAd.

+ (alnonnull ALIncentivizedInterstitialAd *)shared

Discussion

Get a reference to the shared instance of ALIncentivizedInterstitialAd.

This wraps the [ALSdk shared] call, and will only work if you hve set your SDK key in Info.plist.

Declared In

ALIncentivizedInterstitialAd.h

+ preloadAndNotify:

Pre-load an incentivized interstitial, and notify your provided Ad Load Delegate.

+ (void)preloadAndNotify:(alnullable id<ALAdLoadDelegate>)adLoadDelegate

Parameters

adLoadDelegate

The delegate to notify that preloading was completed. May be nil.

Discussion

Pre-load an incentivized interstitial, and notify your provided Ad Load Delegate.

Invoke once to preload, then do not invoke again until the ad has has been closed (e.g., ALAdDisplayDelegate’s adWasHidden callback). You may pass a nil argument to preloadAndNotify if you intend to use the synchronous ( isIncentivizedAdReady ) flow. Note that this is NOT recommended; we HIGHLY RECOMMEND you use an ad load delegate. This method uses the shared instance, and will only work if you have set your SDK key in Info.plist. Note that we internally try to pull down the next ad’s resources before you need it. Therefore, this method may complete immediately in many circumstances.

Declared In

ALIncentivizedInterstitialAd.h

+ isReadyForDisplay

Check if an ad is currently ready on this object. You must call preloadAndNotify in order to reach this state.

+ (BOOL)isReadyForDisplay

Return Value

YES if an ad has been loaded into this incentivized interstitial and is ready to display. NO otherwise.

Discussion

Check if an ad is currently ready on this object. You must call preloadAndNotify in order to reach this state.

It is highly recommended that you implement an asynchronous flow (using an ALAdLoadDelegate with preloadAndNotify) rather than checking this property. This class does not contain a queue and can hold only one preloaded ad at a time. Therefore, you should NOT simply call preloadAndNotify: any time this method returns NO; it is important to invoke only one ad load - then not invoke any further loads until the ad has been closed (e.g., ALAdDisplayDelegate’s adWasHidden callback).

Declared In

ALIncentivizedInterstitialAd.h

+ show

Show an incentivized interstitial over the current key window, using the most recently pre-loaded ad.

+ (void)show

Discussion

Show an incentivized interstitial over the current key window, using the most recently pre-loaded ad.

You must call preloadAndNotify before calling showOver.

Declared In

ALIncentivizedInterstitialAd.h

+ showAndNotify:

Show an incentivized interstitial over the current key window, using the most recently pre-loaded ad.

+ (void)showAndNotify:(alnullable id<ALAdRewardDelegate>)adRewardDelegate

Parameters

adRewardDelegate

The reward delegate to notify upon validating reward authenticity with AppLovin.

Discussion

Show an incentivized interstitial over the current key window, using the most recently pre-loaded ad.

You must call preloadAndNotify before calling showOver.

Using the ALAdRewardDelegate, you will be able to verify with AppLovin servers the the video view is legitimate, as we will confirm whether the specific ad was actually served - then we will ping your server with a url for you to update the user’s balance. The Reward Validation Delegate will tell you whether we were able to reach our servers or not. If you receive a successful response, you should refresh the user’s balance from your server. For more info, see the documentation.

Declared In

ALIncentivizedInterstitialAd.h

+ showOver:andNotify:

Show an incentivized interstitial, using the most recently pre-loaded ad.

+ (void)showOver:(alnonnull UIWindow *)window andNotify:(alnullable id<ALAdRewardDelegate>)adRewardDelegate

Parameters

window

The UIWindow over which the rewarded video should be displayed.

adRewardDelegate

The reward delegate to notify upon validating reward authenticity with AppLovin.

Discussion

Show an incentivized interstitial, using the most recently pre-loaded ad.

You must call preloadAndNotify before calling showOver.

Using the ALAdRewardDelegate, you will be able to verify with AppLovin servers the the video view is legitimate, as we will confirm whether the specific ad was actually served - then we will ping your server with a url for you to update the user’s balance. The Reward Validation Delegate will tell you whether we were able to reach our servers or not. If you receive a successful response, you should refresh the user’s balance from your server. For more info, see the documentation.

Declared In

ALIncentivizedInterstitialAd.h

Integration, Instance Methods

– initWithSdk:

Initialize an incentivized interstitial with a specific custom SDK.

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

Parameters

anSdk

An SDK instance to use.

Discussion

Initialize an incentivized interstitial with a specific custom SDK.

This is necessary if you use [ALSdk sharedWithKey: …].

Declared In

ALIncentivizedInterstitialAd.h

– preloadAndNotify:

Pre-load an incentivized interstitial, and notify your provided Ad Load Delegate.

- (void)preloadAndNotify:(alnullable id<ALAdLoadDelegate>)adLoadDelegate

Parameters

adLoadDelegate

The delegate to notify that preloading was completed.

Discussion

Pre-load an incentivized interstitial, and notify your provided Ad Load Delegate.

Invoke once to preload, then do not invoke again until the ad has has been closed (e.g., ALAdDisplayDelegate’s adWasHidden callback). You may pass a nil argument to preloadAndNotify if you intend to use the synchronous ( isIncentivizedAdReady ) flow. Note that this is NOT recommended; we HIGHLY RECOMMEND you use an ad load delegate. Note that we internally try to pull down the next ad’s resources before you need it. Therefore, this method may complete immediately in many circumstances.

Declared In

ALIncentivizedInterstitialAd.h

  readyForDisplay

Check if an ad is currently ready on this object. You must call preloadAndNotify in order to reach this state.

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

Return Value

YES if an ad has been loaded into this incentivized interstitial and is ready to display. NO otherwise.

Discussion

Check if an ad is currently ready on this object. You must call preloadAndNotify in order to reach this state.

It is highly recommended that you implement an asynchronous flow (using an ALAdLoadDelegate with preloadAndNotify) rather than checking this property. This class does not contain a queue and can hold only one preloaded ad at a time. Therefore, you should NOT simply call preloadAndNotify: any time this method returns NO; it is important to invoke only one ad load - then not invoke any further loads until the ad has been closed (e.g., ALAdDisplayDelegate’s adWasHidden callback).

Declared In

ALIncentivizedInterstitialAd.h

– show

Show an incentivized interstitial over the current key window, using the most recently pre-loaded ad.

- (void)show

Discussion

Show an incentivized interstitial over the current key window, using the most recently pre-loaded ad.

You must call preloadAndNotify before calling showOver.

Declared In

ALIncentivizedInterstitialAd.h

– showAndNotify:

Show an incentivized interstitial over the current key window, using the most recently pre-loaded ad.

- (void)showAndNotify:(alnullable id<ALAdRewardDelegate>)adRewardDelegate

Parameters

adRewardDelegate

The reward delegate to notify upon validating reward authenticity with AppLovin.

Discussion

Show an incentivized interstitial over the current key window, using the most recently pre-loaded ad.

You must call preloadAndNotify before calling showOver.

Using the ALAdRewardDelegate, you will be able to verify with AppLovin servers the the video view is legitimate, as we will confirm whether the specific ad was actually served - then we will ping your server with a url for you to update the user’s balance. The Reward Validation Delegate will tell you whether we were able to reach our servers or not. If you receive a successful response, you should refresh the user’s balance from your server. For more info, see the documentation.

Declared In

ALIncentivizedInterstitialAd.h

– showOver:andNotify:

Show an incentivized interstitial, using the most recently pre-loaded ad.

- (void)showOver:(alnonnull UIWindow *)window andNotify:(alnullable id<ALAdRewardDelegate>)adRewardDelegate

Parameters

window

The UIWindow over which the rewarded video should be displayed.

adRewardDelegate

The reward delegate to notify upon validating reward authenticity with AppLovin.

Discussion

Show an incentivized interstitial, using the most recently pre-loaded ad.

You must call preloadAndNotify before calling showOver.

Using the ALAdRewardDelegate, you will be able to verify with AppLovin servers that the video view is legitimate, as we will confirm whether the specific ad was actually served - then we will ping your server with a url for you to update the user’s balance. The Reward Validation Delegate will tell you whether we were able to reach our servers or not. If you receive a successful response, you should refresh the user’s balance from your server. For more info, see the documentation.

Declared In

ALIncentivizedInterstitialAd.h

– dismiss

Dismiss an incentivized interstitial prematurely, before video playback has completed.

- (void)dismiss

Discussion

Dismiss an incentivized interstitial prematurely, before video playback has completed.

In most circumstances, this is not recommended, as it may confuse users by denying them a reward.

Declared In

ALIncentivizedInterstitialAd.h

Custom User Identifiers

+ setUserIdentifier:

Set a string which identifies the current user, which will be passed through to your server via our optional S2S postbacks.

+ (void)setUserIdentifier:(alnullable NSString *)userIdentifier

Parameters

userIdentifier

Some descriptive string identifying the user, usually a username.

Discussion

Set a string which identifies the current user, which will be passed through to your server via our optional S2S postbacks.

If you’re using reward validation, you can optionally set a user identifier to be included with currency validation postbacks. For example, a user name. We’ll include this in the postback when we ping your currency endpoint from our server.

Declared In

ALIncentivizedInterstitialAd.h

+ userIdentifier

Get the currently set user identification string.

+ (alnullable NSString *)userIdentifier

Return Value

The last value supplied via setUserIdentifier:

Discussion

Get the currently set user identification string.

Declared In

ALIncentivizedInterstitialAd.h