OOPulseSession
Objective-C
@protocol OOPulseSession <NSObject>
Swift
protocol OOPulseSession : NSObjectProtocol
This protocol is used to interact with an ad session.
You must notify this object of the following events:
- The content has started:
-[OOPulseSession contentStarted]
- The content playback position has changed:
-[OOPulseSession contentPositionChanged:]
- The content has played to completion:
-[OOPulseSession contentFinished]
The session will notify you through the delegate provided to
-[OOPulseSession startSessionWithDelegate:]
.
-
Start the ad session. The provided delegate will be notified when to play the content/ads.
This will trigger an ad break through
-[OOPulseSessionDelegate startAdBreak:]
if any prerolls ads are available, otherwise it will trigger the start of the content through-[OOPulseSessionDelegate startContentPlayback]
.Declaration
Objective-C
- (void)startSessionWithDelegate:(id<OOPulseSessionDelegate>)delegate;
Swift
func start(with delegate: (any OOPulseSessionDelegate)!)
Parameters
delegate
The
OOPulseSessionDelegate
delegate that will be notified. -
Request additional ads for the ad session.
Declaration
Objective-C
- (void)extendSessionWithContentMetadata:(OOContentMetadata *)contentMetadata requestSettings:(OORequestSettings *)requestSettings success: (OOSessionExtensionSuccessBlock)onSuccess;
Swift
func extend(with contentMetadata: OOContentMetadata!, requestSettings: OORequestSettings!, success onSuccess: OOSessionExtensionSuccessBlock!)
Parameters
contentMetadata
Information about the content which a requested ad session is to be played with, as well as information targeting the desired campaign(s).
requestSettings
Information about the environment in which the requested ad(s) will play.
onSuccess
The
OOSessionExtensionSuccessBlock
that will be notified when the session extension completes. -
Forcefully stop the session.
This may be called at any time during a session. No further delegate methods will be called after the session is stopped.
Declaration
Objective-C
- (void)stopSession;
Swift
func stop()
-
Notify the session that content playback has started.
This should only be called after your delegate has been instructed to play the content through
-[OOPulseSessionDelegate startContentPlayback]
, or if you have previously paused it with a call to-[OOPulseSession contentPaused]
.Declaration
Objective-C
- (void)contentStarted;
Swift
func contentStarted()
-
Notify the session that the content playback position has changed, either as a result of seeking or normal playback.
This may trigger an ad break through
-[OOPulseSessionDelegate startAdBreak:]
if any midroll ads are available.Declaration
Objective-C
- (void)contentPositionChanged:(NSTimeInterval)position;
Swift
func contentPositionChanged(_ position: TimeInterval)
Parameters
position
The content position in seconds since start.
-
Notify the session that content playback has been paused by the user.
This may trigger a pause ad to display through
-[OOPulseSessionDelegate showPauseAd:]
, if such an ad is available.Declaration
Objective-C
- (void)contentPaused;
Swift
func contentPaused()
-
Notify the session that the content has played to completion.
This may trigger an ad break through
-[OOPulseSessionDelegate startAdBreak:]
if any postroll ads are available.Declaration
Objective-C
- (void)contentFinished;
Swift
func contentFinished()