SegmentBridge

interface SegmentBridge

Bridge to Segment's analytics-swift SDK, implemented in Swift by the app.

analytics-swift exposes a pure-Swift API that is not visible to Kotlin/Native interop, so the app adds the SDK via SwiftPM and injects an adapter implementing this interface. A ready-made adapter is published as the autograph-segment-swift Swift package, making the wiring a single line.

JSON payloads cross the bridge as strings; the Swift adapter decodes them, applies messageId to the event's messageId, and merges the instrumentation object into context.instrumentation via an enrichment closure.

Functions

Link copied to clipboard
abstract fun flush()
Link copied to clipboard
abstract fun identify(userId: String, traitsJson: String, messageId: String, instrumentationJson: String)
Link copied to clipboard
abstract fun reset()
Link copied to clipboard
abstract fun screen(name: String, propertiesJson: String, messageId: String, instrumentationJson: String)
Link copied to clipboard
abstract fun track(name: String, propertiesJson: String, messageId: String, instrumentationJson: String)