Install
Install on iOS
Add the Sankofa iOS SDK to your Xcode project via Swift Package Manager or CocoaPods, with first-class Swift and Objective-C support.
The Sankofa iOS SDK is a native Swift library with Objective-C interop. It includes six Sankofa products (Analytics, Catch, Switch, Config, Pulse, Replay) and uses GRDB for thread-safe SQLite-backed offline queueing. Apple Privacy Manifest support is built in.
OTA Deploy is not exposed on iOS — for hybrid apps that need OTA, use the React Native SDK.
Requirements
- Xcode 15+ (Swift 5.9+)
- iOS 13+ deployment target
- Privacy Manifest support (Apple 2024 requirement) — bundled with the SDK
1. Add the SDK
In Xcode:
- Open File → Add Package Dependencies…
- Enter the URL:
https://github.com/sankofa-hq/sankofa-ios - Pick Up to Next Major Version from
0.1.0. - Add the
SankofaIOSlibrary to your app target.
Or pin in Package.swift:
.package(url: "https://github.com/sankofa-hq/sankofa-ios.git", from: "0.1.0")platform :ios, '13.0'
target 'YourApp' do
use_frameworks!
pod 'SankofaIOS', '~> 0.1'
endpod installNote: the Swift target name is SankofaIOS. Import with import SankofaIOS.
2. Initialize at app launch
Initialize early — in @main's init() or application(_:didFinishLaunchingWithOptions:) — so device metadata flows into every event from the first frame.
import SwiftUI
import SankofaIOS
@main
struct YourApp: App {
init() {
Sankofa.shared.initialize(
apiKey: ProcessInfo.processInfo.environment["SANKOFA_KEY"] ?? "",
config: SankofaConfig(
endpoint: "https://api.sankofa.dev",
recordSessions: true,
maskAllInputs: true
)
)
}
var body: some Scene {
WindowGroup { ContentView() }
}
}#import <SankofaIOS/SankofaIOS-Swift.h>
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
SankofaConfig *config = [[SankofaConfig alloc] initWithEndpoint:@"https://api.sankofa.dev"
debug:NO
trackLifecycleEvents:YES
flushIntervalSeconds:30
batchSize:50
recordSessions:YES
maskAllInputs:YES];
[[Sankofa shared] initializeWithApiKey:@"sk_live_..." config:config];
return YES;
}Common config options
endpointStringdefault https://api.sankofa.devrecordSessionsBooldefault truemaskAllInputsBooldefault truedebugBooldefault falsetrackLifecycleEventsBooldefault trueflushIntervalSecondsTimeIntervaldefault 30batchSizeIntdefault 50captureScaleCGFloatdefault 0.353. Verify the install
Sankofa.shared.track("install_check", properties: ["from": "ios-quickstart"])Build and run in the simulator or on a device. Open app.sankofa.dev → Live events — the event should appear with an ios source label within a few seconds.