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: renametype→eventTypeandpayload→metrics
to match the canonical wire format (event_type/metrics).SynheartBehavior.startSession()now returns aBehaviorSession
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
AsyncStreamandasync/await)..ephemeralnotification
authorization is gated behind#available(iOS 14.0, *).
Added
events: AsyncStream<BehaviorEvent>— async-iteration API mirroring
the KotlinonEvent: Flowand FlutteronEvent: Stream. Coexists
with the existingsetEventHandlercallback via internal fan-out.checkNotificationPermission() async -> Booland
requestNotificationPermission() async -> Boolvia
UNUserNotificationCenter. iOS-no-opcheckCallPermission/
requestCallPermissionfor signature parity with Flutter/Kotlin.BehaviorSessionwrapper class.- Nested types on
BehaviorSessionSummarymatching Kotlin/Flutter:
MotionState,DeviceContext,ActivitySummary,DeepFocusBlock,
BehavioralMetricsStruct,NotificationSummary,SystemState,
TypingMetrics,TypingSessionSummary. ML-scored and aggregate
fields default tonil/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