Skip to content

iOS SDK

Herald for iOS is a set of Swift packages: the core, one package per vendor, optional SwiftUI helpers, a logger and a fake for your tests. Each vendor package works over that vendor's official iOS SDK.

API reference Notes Changelog Source

Installation

In Xcode, choose File → Add Package Dependencies, and add herald-ios and one package for each analytics service you use. In a Package.swift:

dependencies: [
    .package(url: "https://github.com/MkhytarMkhoian/herald-ios", from: "1.3.0"),
    .package(url: "https://github.com/MkhytarMkhoian/herald-ios-firebase", from: "1.3.0"),
]

Then add the modules to your targets: HeraldCore and the vendor modules to your app, and HeraldTesting to your test target only. For tracking from SwiftUI views, add HeraldSwiftUI to your app too.

All packages share one version. Each vendor package is its own repository, so an app downloads only the vendor SDKs it uses.

Packages

Package Modules What it is
herald-ios HeraldCore Events, properties and Herald itself. No vendor SDK or DI library.
HeraldLog Prints every call, for debug builds.
HeraldTesting FakeAnalyticsProvider, a fake vendor that records events so your tests can check them.
HeraldSwiftUI Tracks from SwiftUI views: screen views each time a screen becomes visible, and impressions when something is really on screen. Optional.
HeraldInterop Lets Kotlin Multiplatform code use a Herald set up in Swift. Optional.
herald-ios-firebase HeraldFirebase Sends to Firebase Analytics (GA4).
herald-ios-mixpanel HeraldMixpanel Sends to Mixpanel: events, user profile and super properties.
herald-ios-amplitude HeraldAmplitude Sends to Amplitude: events, user properties, screen views and revenue.
herald-ios-adjust HeraldAdjust Sends to Adjust: events by dashboard token, purchases and ad revenue.
herald-ios-appsflyer HeraldAppsFlyer Sends to AppsFlyer: conversions, purchases, subscriptions and ad revenue.
herald-ios-meta HeraldMeta Sends to Meta: conversions and purchases, for Meta's ads.

Feature modules usually need only HeraldCore, plus the vendor module for each vendor they write a factory for. The app, which sets up Herald, depends on every vendor package.

Compatibility

Herald needs iOS 15 or newer and Xcode 16 or newer, and is written in Swift 6. It is built and tested against these vendor SDKs:

SDK Version
Firebase 12
mixpanel-swift 6
Amplitude-Swift 1.12 or newer
Adjust 5
AppsFlyer 7
Meta (facebook-ios-sdk) 18

Each vendor package allows newer versions of its SDK within the same major version. A new major version of an SDK may need a Herald release.

iOS notes

Where iOS differs from the other platforms is in the iOS notes.