YASInterstitialAdDelegate

Objective-C

@protocol YASInterstitialAdDelegate <NSObject>

Swift

protocol YASInterstitialAdDelegate : NSObjectProtocol

Protocol for receiving notifications from the YASInterstitialAd. These notifications will be called on an arbitrary queue.

  • Called when the YASInterstitialAd has been successfully fetched and its content loaded in preparation for display. Note that this method is only called when ad fetching and loading is performed via the asynchronous -[YASInterstitialAd loadWithPlacementConfig:] method.

    Declaration

    Objective-C

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

    Swift

    func interstitialAdDidLoad(_ interstitialAd: YASInterstitialAd)

    Parameters

    interstitialAd

    The YASInterstitialAd that was loaded.

  • Called when an error occurs during the YASInterstitialAd fetch and load lifecycle. A YASErrorInfo object provides detail about the error. Note that this method is only called when ad fetching and loading is performed via the asynchronous -[YASInterstitialAd loadWithPlacementConfig:] method.

    Declaration

    Objective-C

    - (void)interstitialAdLoadDidFail:(nonnull YASInterstitialAd *)interstitialAd
                            withError:(nonnull YASErrorInfo *)errorInfo;

    Swift

    func interstitialAdLoadDidFail(_ interstitialAd: YASInterstitialAd, withError errorInfo: YASErrorInfo)

    Parameters

    interstitialAd

    The YASInterstitialAd that experienced the error.

    errorInfo

    The YASErrorInfo that describes the error that occurred.

  • Called when an error occurs during the YASInterstitialAd lifecycle. A YASErrorInfo object provides detail about the error.

    Declaration

    Objective-C

    - (void)interstitialAdDidFail:(nonnull YASInterstitialAd *)interstitialAd
                        withError:(nonnull YASErrorInfo *)errorInfo;

    Swift

    func interstitialAdDidFail(_ interstitialAd: YASInterstitialAd, withError errorInfo: YASErrorInfo)

    Parameters

    interstitialAd

    The YASInterstitialAd that experienced the error.

    errorInfo

    The YASErrorInfo that describes the error that occurred.

  • Called when the YASInterstitialAd has been shown.

    Declaration

    Objective-C

    - (void)interstitialAdDidShow:(nonnull YASInterstitialAd *)interstitialAd;

    Swift

    func interstitialAdDidShow(_ interstitialAd: YASInterstitialAd)

    Parameters

    interstitialAd

    The YASInterstitialAd that was shown.

  • Called when the YASInterstitialAd has been closed.

    Declaration

    Objective-C

    - (void)interstitialAdDidClose:(nonnull YASInterstitialAd *)interstitialAd;

    Swift

    func interstitialAdDidClose(_ interstitialAd: YASInterstitialAd)

    Parameters

    interstitialAd

    The YASInterstitialAd that was closed.

  • Called when the YASInterstitialAd has been clicked.

    Declaration

    Objective-C

    - (void)interstitialAdClicked:(nonnull YASInterstitialAd *)interstitialAd;

    Swift

    func interstitialAdClicked(_ interstitialAd: YASInterstitialAd)

    Parameters

    interstitialAd

    The YASInterstitialAd that was clicked.

  • Called when the YASInterstitialAd causes the user to leave the application. For example, tapping a YASInterstitialAd may launch an external browser.

    Declaration

    Objective-C

    - (void)interstitialAdDidLeaveApplication:
        (nonnull YASInterstitialAd *)interstitialAd;

    Swift

    func interstitialAdDidLeaveApplication(_ interstitialAd: YASInterstitialAd)

    Parameters

    interstitialAd

    The YASInterstitialAd that caused the application exit.

  • This callback is used to surface additional events to the publisher from the SDK.

    Declaration

    Objective-C

    - (void)interstitialAdEvent:(nonnull YASInterstitialAd *)interstitialAd
                         source:(nonnull NSString *)source
                        eventId:(nonnull NSString *)eventId
                      arguments:(nullable NSDictionary<NSString *, id> *)arguments;

    Swift

    func interstitialAdEvent(_ interstitialAd: YASInterstitialAd, source: String, eventId: String, arguments: [String : Any]?)

    Parameters

    interstitialAd

    The YASInterstitialAd that is relaying the event.

    source

    The identifier of the event source.

    eventId

    The event identifier.

    arguments

    A dictionary of key/value pairs of arguments related to the event.