Session Manager
Manages the lifecycle of a Sonar fraud-detection session: creation, refresh, keep-alive, and per-account local persistence.
A session only backs a payment once it has been associated with a Frame account, and sessions go stale — the server requires the session's latest device event to be recent, and only a create or update call records one. Call ensureSession before taking a payment.
Constructors
Functions
Returns a session for accountId that is fresh enough to back a payment, creating or refreshing one if necessary. Idempotent, and coalesces concurrent callers for the same account onto a single round trip.
Establishes a session for the legacy, pre-account flow this class originally supported. Preserved for existing callers; ensureSession is the account-scoped equivalent.
Records a Sonar device event when an SDK entry-point view is presented. Mirrors iOS refreshOnFlowEntry(accountId:): opportunistic, never blocks presentation, and refreshes the pre-account session when accountId is null so adoption later preserves device history.