SASInterstitialManagerDelegate

Objective-C

@protocol SASInterstitialManagerDelegate <NSObject>

Swift

protocol SASInterstitialManagerDelegate : NSObjectProtocol

Protocol that must be implemented by SASInterstitialManager delegate.

  • Notifies the delegate that an ad has been loaded and is ready to be displayed.

    Declaration

    Objective-C

    - (void)interstitialManager:(nonnull SASInterstitialManager *)manager
                      didLoadAd:(nonnull SASAd *)ad;

    Swift

    optional func interstitialManager(_ manager: SASInterstitialManager, didLoad ad: SASAd)

    Parameters

    manager

    The instance of SASInterstitialManager that called this delegate method.

    ad

    The ad that has been loaded.

  • Notifies the delegate that the last ad call has failed. Check the error for more information.

    Declaration

    Objective-C

    - (void)interstitialManager:(nonnull SASInterstitialManager *)manager
         didFailToLoadWithError:(nonnull NSError *)error;

    Swift

    optional func interstitialManager(_ manager: SASInterstitialManager, didFailToLoadWithError error: Error)

    Parameters

    manager

    The instance of SASInterstitialManager that called this delegate method.

    error

    The error that occurred during the ad loading.

  • Notifies the delegate that the ad cannot be displayed. Check the error for more information.

    Declaration

    Objective-C

    - (void)interstitialManager:(nonnull SASInterstitialManager *)manager
         didFailToShowWithError:(nonnull NSError *)error;

    Swift

    optional func interstitialManager(_ manager: SASInterstitialManager, didFailToShowWithError error: Error)

    Parameters

    manager

    The instance of SASInterstitialManager that called this delegate method.

    error

    The error that occurred when showing the ad.

  • Notifies the delegate that the ad has been displayed.

    Declaration

    Objective-C

    - (void)interstitialManager:(nonnull SASInterstitialManager *)manager
        didAppearFromViewController:(nonnull UIViewController *)viewController;

    Swift

    optional func interstitialManager(_ manager: SASInterstitialManager, didAppearFrom viewController: UIViewController)

    Parameters

    manager

    The instance of SASInterstitialManager that called this delegate method.

    viewController

    The view controller used to display the ad.

  • Notifies the delegate that the ad has been closed.

    Declaration

    Objective-C

    - (void)interstitialManager:(nonnull SASInterstitialManager *)manager
        didDisappearFromViewController:(nonnull UIViewController *)viewController;

    Swift

    optional func interstitialManager(_ manager: SASInterstitialManager, didDisappearFrom viewController: UIViewController)

    Parameters

    manager

    The instance of SASInterstitialManager that called this delegate method.

    viewController

    The view controller used to display the ad.

  • Notifies the delegate that a video event has been sent by the video player.

    Note

    This method will only be called in case of video ad.

    Declaration

    Objective-C

    - (void)interstitialManager:(nonnull SASInterstitialManager *)manager
              didSendVideoEvent:(SASVideoEvent)videoEvent;

    Swift

    optional func interstitialManager(_ manager: SASInterstitialManager, didSend videoEvent: SASVideoEvent)

    Parameters

    manager

    The instance of SASInterstitialManager that called this delegate method.

    videoEvent

    The video event sent by the video player.

  • Deprecated

    Returns whether the SDK should handle the opening of a given click URL.

    Note

    Click counting will happen no matter if the URL is handled by the SDK or by your application.

    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 is case of click, please implement interstitialManager:didClickWithURL: delegate method.

    Declaration

    Objective-C

    - (BOOL)interstitialManager:(nonnull SASInterstitialManager *)manager
                shouldHandleURL:(nonnull NSURL *)URL;

    Swift

    optional func interstitialManager(_ manager: SASInterstitialManager, shouldHandle URL: URL) -> Bool

    Parameters

    manager

    The instance of SASInterstitialManager that called this delegate method.

    URL

    The URL that must be handled.

    Return Value

    YES if the URL must be handled by the SDK, NO if your application will handle the URL itself.

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

    Declaration

    Objective-C

    - (void)interstitialManager:(nonnull SASInterstitialManager *)manager
                didClickWithURL:(nonnull NSURL *)URL;

    Swift

    optional func interstitialManager(_ manager: SASInterstitialManager, didClickWith URL: URL)

    Parameters

    manager

    The instance of SASInterstitialManager

    URL

    The URL that is called.

  • Notifies the delegate that a message has been sent by the MRAID creative.

    MRAID creatives can send messages using mraid.sasSendMessage(“message”). These messages are sent to the interstitial manager delegate by the SDK. Please note that this method IS NOT PART of MRAID 2.0 specification.

    Declaration

    Objective-C

    - (void)interstitialManager:(nonnull SASInterstitialManager *)manager
              didReceiveMessage:(nonnull NSString *)message;

    Swift

    optional func interstitialManager(_ manager: SASInterstitialManager, didReceiveMessage message: String)

    Parameters

    manager

    The instance of SASInterstitialManager that called this delegate method.

    message

    The message sent by the creative.

  • Notifies the delegate that a click modal view controller will be open.

    Declaration

    Objective-C

    - (void)interstitialManager:(nonnull SASInterstitialManager *)manager
        willPresentModalViewFromViewController:
            (nonnull UIViewController *)viewController;

    Swift

    optional func interstitialManager(_ manager: SASInterstitialManager, willPresentModalViewFrom viewController: UIViewController)

    Parameters

    manager

    The instance of SASInterstitialManager that called this delegate method.

    viewController

    The view controller used to display the ad.

  • Notifies the delegate that a click modal view controller will be closed.

    Declaration

    Objective-C

    - (void)interstitialManager:(nonnull SASInterstitialManager *)manager
        willDismissModalViewFromViewController:
            (nonnull UIViewController *)viewController;

    Swift

    optional func interstitialManager(_ manager: SASInterstitialManager, willDismissModalViewFrom viewController: UIViewController)

    Parameters

    manager

    The instance of SASInterstitialManager that called this delegate method.

    viewController

    The view controller used to display the ad.

  • Returns whether the SDK should handle the audio session.

    The SDK might want to handle the audio session when playing some video ads to control how the ad sound will interact with other apps or to completely mute the ad.

    Declaration

    Objective-C

    - (BOOL)interstitialManagerShouldHandleAudioSession:
        (nonnull SASInterstitialManager *)manager;

    Swift

    optional func interstitialManagerShouldHandleAudioSession(_ manager: SASInterstitialManager) -> Bool

    Parameters

    manager

    The instance of SASInterstitialManager that called this delegate method.

    Return Value

    YES if the SDK can handle the audio session, NO if your application can handle the session itself.

  • Notifies the delegate that the ad will start playing audio.

    Declaration

    Objective-C

    - (void)interstitialManagerWillPlayAudio:
        (nonnull SASInterstitialManager *)manager;

    Swift

    optional func interstitialManagerWillPlayAudio(_ manager: SASInterstitialManager)

    Parameters

    manager

    The instance of SASInterstitialManager that called this delegate method.

  • Notifies the delegate that the ad will stop playing audio.

    Declaration

    Objective-C

    - (void)interstitialManagerDidFinishPlayingAudio:
        (nonnull SASInterstitialManager *)manager;

    Swift

    optional func interstitialManagerDidFinishPlayingAudio(_ manager: SASInterstitialManager)

    Parameters

    manager

    The instance of SASInterstitialManager that called this delegate method.