iOS SDK (Core)

API Reference

26min

Please find below an overview of the available APIs for you to use. Also check out the Guides & Tutorials chapter for useful information about using the SDK.

ExperiencePlaybackService

ExperiencePlaybackService is the fundamental component within the SDK, serving as the main hub for all interactions between your application and the SDK. Think of it as the command center or the control room—it manages how the app communicates with the SDK, making sure they understand each other and work together seamlessly. Here's an overview of the interface:

EXP Manifest

Retrieving the information of the current EXP manifest:

Swift


Playback

The SDK provides certain methods to control a playback.

Initialize Playback

Initializing the playback will set the playback view and sets a PlaybackDelegate.

Swift


Playback Delegate

Setting a PlaybackDelegate will trigger the respective callback methods.

Swift


Playback Controls

Start Playback

If the current program is a live event, the playback will automatically start at the live edge. If it is a VOD playback, the playback will start from the beginning:

Swift


Pause Playback

Swift


Resume Playback

Swift


Stop Playback

Swift


Mute/Unmute Audio

Swift


Seek to a position

Swift


Jump backward/forward

Swift


Content

Get available Entities

Swift


Get selected Entity

Swift


Set Entity

Swift


Second-Screen Sync

If the second-screen sync is set-up and configured for your company, it is easy to enable it in the SDK.

Enable Sync

The second-screen sync can be enabled using the SyncConfig. The SyncConfig offers three options:

  • SYNC_ONLY a sync against a main screen is required for playback
  • SYNC_OPTIONAL the sync is optional and if sync information is available, the user can choose to sync to a main screen
  • SYNC_NO the sync is disabled

To set the SyncConfig just do the following:

Swift


AudioSyncMode

There are two modes the second-screen sync can be used:

  • channelSync to sync against a live channel, e.g. a TV channel
  • directSync to sync against a VOD event

ChannelSync

The AudioSyncMode is set to AudioSyncMode.CHANNEL by default.

To set the AudioSyncMode just call:

Swift


All settings for the ChannelSync are configured via the AppConfig in the Console. There the endpoint as well as the channel information required for syncing is set.

In case you want to overwrite the backend setting, you can manually set a channelId:

Swift


DirectSync

To enable the direct sync to e.g. sync against a VOD event, you need to set the AudioSyncMode to AudioSyncMode.LIBRARY:

Swift


Additionally, you need to set a directSyncId, so the correct sync query is used:

Swift


The directSyncId is created when sync information is extracted for VOD events. A common setup is to send the directSyncId as part of event information like the programId.

Custom SMDS Endpoint

Setting a custom SMDS endpoint will direct the audio parts to be checked for a sync to the given service.

Swift


Initialize Sync

Initializing the sync will set up all necessary dependencies for operational mode and sets a SyncDelegate.

Swift


Sync Delegate

Setting a SyncDelegate will trigger the respective callback methods.

Swift


Sync Controls

To programmatically start, stop or cancel a sync, the interface provides the following methods:

Swift


Check current sync state

To check the current playback sync state:

Swift


Dismiss Experience

Stopping the whole experience resets everything. If a new EXP program needs to be started, the old experience should be stopped before in order to avoid any misfunction. If the close button within a PlaybackViewController was tapped, this method is being called automatically and does not need to be triggered separately.

Swift


NwExpUI

NwExpUI serves as a customizable interface to GUI Overlays. The communication with the web layer is done using methods to send and receive certain events and states. The class described in the section below wraps this functionality.

If you want to know more about the underlying system and the event system that is used to communicate between the native and web layer, you can find a more thorough explanation in the Event System chapter of the Web SDK.

Initialize EXP

See Getting Started on how to setup and start a full experience.