Skip to content

v0.4.0 — API parity pass

Latest

Choose a tag to compare

@isrugeek isrugeek released this 16 May 04:14
· 5 commits to main since this release

API-parity pass. Brings the Swift SDK's surface into alignment with the
Flutter and Kotlin siblings so callers see the same shape across all
three platforms.

Breaking

  • BehaviorEvent: rename typeeventType and payloadmetrics
    to match the canonical wire format (event_type / metrics).
  • SynheartBehavior.startSession() now returns a BehaviorSession
    object with .sessionId, .startTimestamp, .end() throws, and
    .getCurrentDuration(). Callers that read the session ID can use
    try sdk.startSession().sessionId.
  • Minimum iOS deployment target bumped from 12.0 to 13.0 (required for
    AsyncStream and async/await). .ephemeral notification
    authorization is gated behind #available(iOS 14.0, *).

Added

  • events: AsyncStream<BehaviorEvent> — async-iteration API mirroring
    the Kotlin onEvent: Flow and Flutter onEvent: Stream. Coexists
    with the existing setEventHandler callback via internal fan-out.
  • checkNotificationPermission() async -> Bool and
    requestNotificationPermission() async -> Bool via
    UNUserNotificationCenter. iOS-no-op checkCallPermission /
    requestCallPermission for signature parity with Flutter/Kotlin.
  • BehaviorSession wrapper class.
  • Nested types on BehaviorSessionSummary matching Kotlin/Flutter:
    MotionState, DeviceContext, ActivitySummary, DeepFocusBlock,
    BehavioralMetricsStruct, NotificationSummary, SystemState,
    TypingMetrics, TypingSessionSummary. ML-scored and aggregate
    fields default to nil/zeros until a downstream consumer populates
    them.

Tests

  • All 33 SDK tests pass on the renamed surface.

Full Changelog: https://github.com/synheart-ai/synheart-behavior-swift/commits/v0.4.0