Skip to content

iOS SDK ​

The Havik iOS SDK (Swift package HavikPlayer, v3.1.0) plays FairPlay-protected live streams on iPhone and iPad. Install it with Swift Package Manager from the public oddin-gg/havik-ios-sdk repository.

The iOS SDK is a native port of the JavaScript SDK. It has the same streams, the same play sequence, and the same event and error vocabulary. AVPlayer plays LL-HLS natively, so there is one engine and no browser matrix.

What you get ​

CapabilityiOS
PlaybackLL-HLS over AVPlayer (native, no third-party engine)
DRMFairPlay via AVContentKeySession — certificate, key requests, and license refresh handled for you
AuthAttested sessions (Apple App Attest) — no long-lived key in requests
Integration modesManaged player (HavikPlayer + HavikPlayerView or HavikVideoView) and bring-your-own-player
Events & errorsThe same state machine and typed error taxonomy as the web SDK
Live pickupArm on an upcoming match; attaches when the stream goes live, and rejoins after an interruption
Quality & tracksQuality levels (a ceiling on AVPlayer), audio and subtitle renditions
PresentationSystem PiP and fullscreen, or SDK-owned Picture-in-Picture you start from code; status cards over video

There is no iframe embed mode on iOS; apps use the managed player or BYOP. The full surface is documented in the iOS API reference.

Install ​

In Xcode:

  1. File > Add Package Dependencies…
  2. Enter https://github.com/oddin-gg/havik-ios-sdk.
  3. Dependency rule: Up to Next Major Version, from 3.1.0.
  4. Add the HavikPlayer library to your app target.

Or in Package.swift:

swift
dependencies: [
    .package(url: "https://github.com/oddin-gg/havik-ios-sdk", from: "3.1.0"),
],
targets: [
    .target(name: "YourApp", dependencies: [
        .product(name: "HavikPlayer", package: "havik-ios-sdk"),
    ]),
]

No GitHub account or token is needed. The package ships debug symbols (crash reports show the SDK's frames by name) and a privacy manifest that Xcode merges into your app's privacy report. CocoaPods isn't supported.

Then play a match:

swift
import HavikPlayer
import SwiftUI

let client = HavikClient(
    baseURL: URL(string: "https://feed-dev.oddin-video.gg")!,
    apiKey: "pk_test_…",
    attestation: HavikClient.defaultAttestation()
)
let player = HavikPlayer(client: client, options: PlayerOptions(matchUrn: "od:match:1234"))
player.start()

// In SwiftUI, with AVKit's controls, PiP and fullscreen:
HavikPlayerView(havik: player)

Create the client once and reuse it: it caches the attested session, so later matches start without authenticating again. Show HavikStatusOverlay(havik:) over the player for the ended, error, offline and loading states.

The iOS API reference covers every option, event and error.

Requirements ​

  • iOS 15 or later, and Xcode 26 or later.
  • A physical device for DRM work, because FairPlay does not run in the Simulator.
  • The same onboarding as the web SDK: a publishable api-key provisioned for your app. See getting started.

Parity with the web SDK ​

Web (@oddin-gg/havik-player)iOS (HavikPlayer)
Managed player✅✅
Bring your own player✅✅
Iframe embed✅— (not applicable)
DRMWidevine + FairPlayFairPlay
Typed events / stats✅✅
QoE analytics beacons✅✅
Quality selection✅✅ (a ceiling)
Audio / subtitles✅✅
Programmatic PiP✅✅

Demo app ​

A SwiftUI demo app ships with the SDK and is headed for TestFlight and the App Store:

Havik app icon (iOS)Havik Player DemoiOS · App StoreComing soon

Want early access? havik-support@oddin.gg

Your api-key ​

Email havik-support@oddin.gg with your bundle id and the domains/apps already on your key, so we can provision it for your app. Building for Android too? See the Android SDK.

ISC licensed. Bundles hls.js (Apache-2.0).