This SDK allows you to integrate ad serving from your Pulse account into your native iOS video player application.
Please see the changelog to see what is new and changed for this version.
(if you’re building for the Apple TV, replace Pulse.framework with Pulse_tvOS.framework)
Getting Started
Download the Pulse framework and add it to your iOS/tvOS project
During the startup of the video player application, you initialise the Pulse SDK and set up the connection to your Pulse account using the +[OOPulse setPulseHost:deviceContainer:persistentId:]
method from OOPulse
.
The standard ad session works well with VOD content, when you want the Pulse SDK to trigger ad breaks based on what the content player is doing (pre- mid- & postrolls triggered based on content player progress, and pause ads triggered when the content is paused).
On the other hand, the Live API’s allows you to create a “live session” which gives you direct access to the ad breaks, letting you prepare and trigger ads when needed. This approach is better suited for live/streaming environments, since it gives you more control over the ad playback timing. Currently, only linear video ads are supported in live sessions.
Using a standard session:
After initialization, use OOPulse
to create an OOPulseSession
. The OOPulseSession
has an OOPulseSessionDelegate
which handles all the communication between the video player and the OOPulseSession
.
When it is time to play a video ad, OOPulseSessionDelegate
will be sent an OOPulseVideoAd
through the -[OOPulseSessionDelegate startAdPlaybackWithAd:timeout:]
method.
Integration sample: OBJ-C
Using a live session:
Use OOPulse
to create a INPulseLiveSession
. An ad request will be sent immediately when the live session is created and the -[INPulseLiveSessionDelegate sessionRequestSuccessful]
callback will be called once the response has been processed. If the ad request is unsuccessful the -[INPulseLiveSessionDelegate sessionRequestFailedWithError:]
callback will be triggered.
In a live session there’s no need to inform the Pulse SDK of the content playback progress or the video player state.
Use -[INPulseLiveSession getAdBreak:atIndex:]
to get access to the ad breaks that were fetched when creating the session, or after extending the session. To access the list of ads in an ad break, call -[INPulseLiveAdBreak getAllLinearAds:]
.
When playing an ad, call -[OOPulseVideoAd adStarted]
, -[OOPulseVideoAd adPositionChanged:]
, -[OOPulseVideoAd adFinished]
, etc, to inform the Pulse SDK of the playback progress; just like when using a standard ad session.