YASInlineAdViewDelegate

Objective-C

@protocol YASInlineAdViewDelegate <NSObject>

Swift

protocol YASInlineAdViewDelegate : NSObjectProtocol

Protocol for receiving notifications from the YASInlineAdView. Unless otherwise specified, all methods will be called on an arbitrary background queue.

  • Called when the YASInlineAdView 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 -[YASInlineAdView loadWithPlacementConfig:] method.

    Declaration

    Objective-C

    - (void)inlineAdDidLoad:(nonnull YASInlineAdView *)inlineAd;

    Swift

    func inlineAdDidLoad(_ inlineAd: YASInlineAdView)

    Parameters

    inlineAd

    The YASInlineAdView that was loaded.

  • Called when an error occurs during the YASInlineAdView 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 -[YASInlineAdView loadWithPlacementConfig:] method.

    Declaration

    Objective-C

    - (void)inlineAdLoadDidFail:(nonnull YASInlineAdView *)inlineAd
                      withError:(nonnull YASErrorInfo *)errorInfo;

    Swift

    func inlineAdLoadDidFail(_ inlineAd: YASInlineAdView, withError errorInfo: YASErrorInfo)

    Parameters

    inlineAd

    The YASInlineAdView that experienced the error.

    errorInfo

    The YASErrorInfo that describes the error that occurred.

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

    Declaration

    Objective-C

    - (void)inlineAdDidFail:(nonnull YASInlineAdView *)inlineAd
                  withError:(nonnull YASErrorInfo *)errorInfo;

    Swift

    func inlineAdDidFail(_ inlineAd: YASInlineAdView, withError errorInfo: YASErrorInfo)

    Parameters

    inlineAd

    The YASInlineAdView that experienced the error.

    errorInfo

    The YASErrorInfo that describes the error that occured.

  • Called when the YASInlineAdView has been shown.

    Declaration

    Objective-C

    - (void)inlineAdDidExpand:(nonnull YASInlineAdView *)inlineAd;

    Swift

    func inlineAdDidExpand(_ inlineAd: YASInlineAdView)

    Parameters

    inlineAd

    The YASInlineAdView that was shown.

  • Called when The YASInlineAdView has been closed.

    Declaration

    Objective-C

    - (void)inlineAdDidCollapse:(nonnull YASInlineAdView *)inlineAd;

    Swift

    func inlineAdDidCollapse(_ inlineAd: YASInlineAdView)

    Parameters

    inlineAd

    The YASInlineAdView that was closed.

  • Called when the YASInlineAdView has been clicked.

    Declaration

    Objective-C

    - (void)inlineAdClicked:(nonnull YASInlineAdView *)inlineAd;

    Swift

    func inlineAdClicked(_ inlineAd: YASInlineAdView)

    Parameters

    inlineAd

    The YASInlineAdView that was clicked.

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

    Declaration

    Objective-C

    - (void)inlineAdDidLeaveApplication:(nonnull YASInlineAdView *)inlineAd;

    Swift

    func inlineAdDidLeaveApplication(_ inlineAd: YASInlineAdView)

    Parameters

    inlineAd

    The YASInlineAdView that caused the application exit.

  • Called after the YASInlineAdView completed resizing.

    Declaration

    Objective-C

    - (void)inlineAdDidResize:(nonnull YASInlineAdView *)inlineAd;

    Swift

    func inlineAdDidResize(_ inlineAd: YASInlineAdView)

    Parameters

    inlineAd

    The YASInlineAdView that caused the application exit.

  • Called after the YASInlineAdView has been refreshed.

    Declaration

    Objective-C

    - (void)inlineAdDidRefresh:(nonnull YASInlineAdView *)inlineAd;

    Swift

    func inlineAdDidRefresh(_ inlineAd: YASInlineAdView)

    Parameters

    inlineAd

    The YASInlineAdView that was refreshed.

  • Called prior to presenting another view controller to use for displaying the fullscreen ad.

    Note that this method is called on the main queue.

    Declaration

    Objective-C

    - (nullable UIViewController *)inlineAdPresentingViewController;

    Swift

    func inlineAdPresentingViewController() -> UIViewController?

    Return Value

    a UIViewController capable of presenting another view controller to use for displaying the fullscreen ad. Returning nil will result in no fullscreen ad being displayed and an error returned to the ad.

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

    Declaration

    Objective-C

    - (void)inlineAd:(nonnull YASInlineAdView *)inlineAd
               event:(nonnull NSString *)eventId
              source:(nonnull NSString *)source
           arguments:(nonnull NSDictionary<NSString *, id> *)arguments;

    Swift

    func inlineAd(_ inlineAd: YASInlineAdView, event eventId: String, source: String, arguments: [String : Any])

    Parameters

    inlineAd

    The YASInlineAdView that is relaying the event.

    eventId

    The event identifier.

    source

    The identifier of the event source.

    arguments

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