YMAInterstitialAdDelegate

Objective-C

@protocol YMAInterstitialAdDelegate <NSObject>

Swift

protocol YMAInterstitialAdDelegate : NSObjectProtocol

The protocol defines the methods of the delegate that tracks ads. Methods are called by an object of the YMAInterstitialAd class when its state changes.

  1. Methods
  2. -interstitialAdDidLoad:
  3. -interstitialAdDidFailToLoad:error:
  4. -interstitialAdWillLeaveApplication:
  5. -interstitialAdDidFailToPresent:error:
  6. -interstitialAdWillAppear:
  7. -interstitialAdDidAppear:
  8. -interstitialAdWillDisappear:
  9. -interstitialAdDidDisappear:
  10. -interstitialAdDidClick:
  11. -interstitialAd:willPresentScreen:
  12. -interstitialAd:didTrackImpressionWithData:

Methods

-interstitialAdDidLoad:

Notifies that the ad loaded successfully.

Declaration

Objective-C

- (void)interstitialAdDidLoad:(nonnull YMAInterstitialAd *)interstitialAd;

Swift

optional func interstitialAdDidLoad(_ interstitialAd: YMAInterstitialAd)

Parameters

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

-interstitialAdDidFailToLoad:error:

Notifies that the ad failed to load.

Declaration

Objective-C

- (void)interstitialAdDidFailToLoad:(nonnull YMAInterstitialAd *)interstitialAd
                              error:(nonnull NSError *)error;

Swift

optional func interstitialAdDidFail(toLoad interstitialAd: YMAInterstitialAd, error: Error)

Parameters

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

error

Information about the error (for details, see YMAAdErrorCode).

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

error

Information about the error (for details, see YMAAdErrorCode).

-interstitialAdWillLeaveApplication:

Notifies that the app will run in the background now because the user clicked on the ad and is about to switch to a different app (Phone, App Store, and so on).

Declaration

Objective-C

- (void)interstitialAdWillLeaveApplication:
    (nonnull YMAInterstitialAd *)interstitialAd;

Swift

optional func interstitialAdWillLeaveApplication(_ interstitialAd: YMAInterstitialAd)

Parameters

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

-interstitialAdDidFailToPresent:error:

Notifies that the ad can’t be displayed.

Declaration

Objective-C

- (void)interstitialAdDidFailToPresent:
            (nonnull YMAInterstitialAd *)interstitialAd
                                 error:(nonnull NSError *)error;

Swift

optional func interstitialAdDidFail(toPresent interstitialAd: YMAInterstitialAd, error: Error)

Parameters

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

error

Information about the error (for details, see YMAAdErrorCode).

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

error

Information about the error (for details, see YMAAdErrorCode).

-interstitialAdWillAppear:

Called before the interstitial ad appears.

Declaration

Objective-C

- (void)interstitialAdWillAppear:(nonnull YMAInterstitialAd *)interstitialAd;

Swift

optional func interstitialAdWillAppear(_ interstitialAd: YMAInterstitialAd)

Parameters

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

-interstitialAdDidAppear:

Called after the interstitial ad appears.

Declaration

Objective-C

- (void)interstitialAdDidAppear:(nonnull YMAInterstitialAd *)interstitialAd;

Swift

optional func interstitialAdDidAppear(_ interstitialAd: YMAInterstitialAd)

Parameters

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

-interstitialAdWillDisappear:

Called before hiding the interstitial ad.

Declaration

Objective-C

- (void)interstitialAdWillDisappear:(nonnull YMAInterstitialAd *)interstitialAd;

Swift

optional func interstitialAdWillDisappear(_ interstitialAd: YMAInterstitialAd)

Parameters

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

-interstitialAdDidDisappear:

Called after hiding the interstitial ad.

Declaration

Objective-C

- (void)interstitialAdDidDisappear:(nonnull YMAInterstitialAd *)interstitialAd;

Swift

optional func interstitialAdDidDisappear(_ interstitialAd: YMAInterstitialAd)

Parameters

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

-interstitialAdDidClick:

Notifies that the user clicked on the ad.

Declaration

Objective-C

- (void)interstitialAdDidClick:(nonnull YMAInterstitialAd *)interstitialAd;

Swift

optional func interstitialAdDidClick(_ interstitialAd: YMAInterstitialAd)

Parameters

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

-interstitialAd:willPresentScreen:

Notifies that the in-app browser will be displayed.

Declaration

Objective-C

- (void)interstitialAd:(nonnull YMAInterstitialAd *)interstitialAd
     willPresentScreen:(nullable UIViewController *)webBrowser;

Swift

optional func interstitialAd(_ interstitialAd: YMAInterstitialAd, willPresentScreen webBrowser: UIViewController?)

Parameters

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

webBrowser

The in-app browser.

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

webBrowser

The in-app browser.

-interstitialAd:didTrackImpressionWithData:

It’s called when an ad impression has been counted.

Declaration

Objective-C

- (void)interstitialAd:(nonnull YMAInterstitialAd *)interstitialAd
    didTrackImpressionWithData:(nullable id<YMAImpressionData>)impressionData;

Parameters

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

impressionData

Revenue data at the level of ad impressions.

interstitialAd

A reference to the object of the YMAInterstitialAd class that invoked the method.

impressionData

Revenue data at the level of ad impressions.