SASRewardedVideoManagerDelegate
Objective-C
@protocol SASRewardedVideoManagerDelegate <NSObject>
Swift
protocol SASRewardedVideoManagerDelegate : NSObjectProtocol
Protocol that must be implemented by SASRewardedVideoManager delegate.
-
Notifies the delegate that an ad has been loaded and is ready to be displayed.
Declaration
Objective-C
- (void)rewardedVideoManager:(nonnull SASRewardedVideoManager *)manager didLoadAd:(nonnull SASAd *)ad;
Swift
optional func rewardedVideoManager(_ manager: SASRewardedVideoManager, didLoad ad: SASAd)
Parameters
manager
The instance of SASRewardedVideoManager 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)rewardedVideoManager:(nonnull SASRewardedVideoManager *)manager didFailToLoadWithError:(nonnull NSError *)error;
Swift
optional func rewardedVideoManager(_ manager: SASRewardedVideoManager, didFailToLoadWithError error: any Error)
Parameters
manager
The instance of SASRewardedVideoManager 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)rewardedVideoManager:(nonnull SASRewardedVideoManager *)manager didFailToShowWithError:(nonnull NSError *)error;
Swift
optional func rewardedVideoManager(_ manager: SASRewardedVideoManager, didFailToShowWithError error: any Error)
Parameters
manager
The instance of SASRewardedVideoManager 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)rewardedVideoManager:(nonnull SASRewardedVideoManager *)manager didAppearFromViewController:(nonnull UIViewController *)viewController;
Swift
optional func rewardedVideoManager(_ manager: SASRewardedVideoManager, didAppearFrom viewController: UIViewController)
Parameters
manager
The instance of SASRewardedVideoManager 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)rewardedVideoManager:(nonnull SASRewardedVideoManager *)manager didDisappearFromViewController:(nonnull UIViewController *)viewController;
Swift
optional func rewardedVideoManager(_ manager: SASRewardedVideoManager, didDisappearFrom viewController: UIViewController)
Parameters
manager
The instance of SASRewardedVideoManager 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)rewardedVideoManager:(nonnull SASRewardedVideoManager *)manager didSendVideoEvent:(SASVideoEvent)videoEvent;
Swift
optional func rewardedVideoManager(_ manager: SASRewardedVideoManager, didSend videoEvent: SASVideoEvent)
Parameters
manager
The instance of SASRewardedVideoManager that called this delegate method.
videoEvent
The video event sent by the video player.
-
Notifies the delegate that a reward has been granted to the user.
Declaration
Objective-C
- (void)rewardedVideoManager:(nonnull SASRewardedVideoManager *)manager didCollectReward:(nonnull SASReward *)reward;
Swift
optional func rewardedVideoManager(_ manager: SASRewardedVideoManager, didCollect reward: SASReward)
Parameters
manager
The instance of SASRewardedVideoManager that called this delegate method.
reward
The reward that has been retrieved.
-
Deprecated
Use ‘rewardedVideoManager:didClickWithURL:’ instead
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 rewardedVideoManager:didClickWithURL: delegate method.
Declaration
Objective-C
- (BOOL)rewardedVideoManager:(nonnull SASRewardedVideoManager *)manager shouldHandleURL:(nonnull NSURL *)URL;
Swift
optional func rewardedVideoManager(_ manager: SASRewardedVideoManager, shouldHandle URL: URL) -> Bool
Parameters
manager
The instance of SASRewardedVideoManager 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 rewarded video ad.
Declaration
Objective-C
- (void)rewardedVideoManager:(nonnull SASRewardedVideoManager *)manager didClickWithURL:(nonnull NSURL *)URL;
Swift
optional func rewardedVideoManager(_ manager: SASRewardedVideoManager, didClickWith URL: URL)
Parameters
manager
The instance of SASRewardedVideoManager.
URL
The URL that is called.
-
Notifies the delegate that a click modal view controller will be open.
Declaration
Objective-C
- (void)rewardedVideoManager:(nonnull SASRewardedVideoManager *)manager willPresentModalViewFromViewController: (nonnull UIViewController *)viewController;
Swift
optional func rewardedVideoManager(_ manager: SASRewardedVideoManager, willPresentModalViewFrom viewController: UIViewController)
Parameters
manager
The instance of SASRewardedVideoManager 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)rewardedVideoManager:(nonnull SASRewardedVideoManager *)manager willDismissModalViewFromViewController: (nonnull UIViewController *)viewController;
Swift
optional func rewardedVideoManager(_ manager: SASRewardedVideoManager, willDismissModalViewFrom viewController: UIViewController)
Parameters
manager
The instance of SASRewardedVideoManager 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)rewardedVideoManagerShouldHandleAudioSession: (nonnull SASRewardedVideoManager *)manager;
Swift
optional func rewardedVideoManagerShouldHandleAudioSession(_ manager: SASRewardedVideoManager) -> Bool
Parameters
manager
The instance of SASRewardedVideoManager 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)rewardedVideoManagerWillPlayAudio: (nonnull SASRewardedVideoManager *)manager;
Swift
optional func rewardedVideoManagerWillPlayAudio(_ manager: SASRewardedVideoManager)
Parameters
manager
The instance of SASRewardedVideoManager that called this delegate method.
-
Notifies the delegate that the ad will stop playing audio.
Declaration
Objective-C
- (void)rewardedVideoManagerDidFinishPlayingAudio: (nonnull SASRewardedVideoManager *)manager;
Swift
optional func rewardedVideoManagerDidFinishPlayingAudio(_ manager: SASRewardedVideoManager)
Parameters
manager
The instance of SASRewardedVideoManager that called this delegate method.
-
Notifies the delegate that the ad has finished playing the video ad and has open an HTML end card.
Declaration
Objective-C
- (void)rewardedVideoManager:(nonnull SASRewardedVideoManager *)manager didLoadEndCardFromViewController:(nonnull UIViewController *)viewController;
Swift
optional func rewardedVideoManager(_ manager: SASRewardedVideoManager, didLoadEndCardFrom viewController: UIViewController)
Parameters
manager
The instance of SASRewardedVideoManager that called this delegate method.
viewController
The view controller used to display the end card.