SASNativeAdDelegate

Objective-C

@protocol SASNativeAdDelegate <NSObject>

Swift

protocol SASNativeAdDelegate : NSObjectProtocol

Protocol that must be implemented by SASNativeAd delegate.

  • Deprecated

    Use ‘nativeAd:didClickWithURL:’ instead

    Asks the delegate whether the SDK should handles the opening action for the provided URL.

    You can implement this method if you want to process some URLs yourself, for instance to make an in app redirection.

    Note

    Please note that click pixels will be sent, even if you choose to handle a particular URL yourself.

    Note

    This method is deprecated and will be removed in future releases. Publishers should not interfere client-side with clicks to avoid counting issues. However, if you still want to be warned in case of click, implement the nativeAd:didClickWithUrl: method.

    Declaration

    Objective-C

    - (BOOL)nativeAd:(nonnull SASNativeAd *)nativeAd
        shouldHandleClickURL:(nonnull NSURL *)URL;

    Swift

    optional func nativeAd(_ nativeAd: SASNativeAd, shouldHandleClick URL: URL) -> Bool

    Parameters

    nativeAd

    The instance of SASAdNativeAd responsible for the click.

    URL

    The URL that will be called.

    Return Value

    YES if the Smart Display SDK should handle the URL, NO if the app should do it by itself.

  • Notifies the delegate when a click is performed on the native ad.

    Declaration

    Objective-C

    - (void)nativeAd:(nonnull SASNativeAd *)nativeAd
        didClickWithURL:(nonnull NSURL *)URL;

    Swift

    optional func nativeAd(_ nativeAd: SASNativeAd, didClickWith URL: URL)

    Parameters

    nativeAd

    The instance of SASAdNativeAd.

    URL

    The URL that is called.

  • Notifies the delegate that a modal view will appear to display the ad’s landing page.

    Declaration

    Objective-C

    - (void)nativeAdWillPresentModalView:(nonnull SASNativeAd *)nativeAd;

    Swift

    optional func nativeAdWillPresentModalView(_ nativeAd: SASNativeAd)

    Parameters

    nativeAd

    The instance of SASAdNativeAd displaying the modal view.

  • Notifies the delegate that the previously open modal view will be dismissed.

    Declaration

    Objective-C

    - (void)nativeAdWillDismissModalView:(nonnull SASNativeAd *)nativeAd;

    Swift

    optional func nativeAdWillDismissModalView(_ nativeAd: SASNativeAd)

    Parameters

    nativeAd

    The instance of SASAdNativeAd closing the modal view.