IdentityManager

class IdentityManager(val storage: Storage, ioScope: IOScope, stringToSha: (String) -> String = { it }, val notifyUserChange: (change: Map<String, Any>) -> Unit, val completeReset: () -> Unit = { Superwall.instance.reset(duringIdentify = true) }, val tracker: suspend (TrackableSuperwallEvent) -> Unit = { Superwall.instance.track(it) }, options: () -> SuperwallOptions, val webPaywallRedeemer: () -> WebPaywallRedeemer, val actor: StateActor<IdentityContext, IdentityState>, val sdkContext: SdkContext) : IdentityContext(source)

Facade over the identity state of the shared SDK actor.

Implements IdentityContext directly — actions receive this as their context, eliminating the intermediate object.

Constructors

Link copied to clipboard
constructor(storage: Storage, ioScope: IOScope, stringToSha: (String) -> String = { it }, notifyUserChange: (change: Map<String, Any>) -> Unit, completeReset: () -> Unit = { Superwall.instance.reset(duringIdentify = true) }, tracker: suspend (TrackableSuperwallEvent) -> Unit = { Superwall.instance.track(it) }, options: () -> SuperwallOptions, webPaywallRedeemer: () -> WebPaywallRedeemer, actor: StateActor<IdentityContext, IdentityState>, sdkContext: SdkContext)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val completeReset: () -> Unit
Link copied to clipboard
Link copied to clipboard
val hasIdentity: Flow<Boolean>
Link copied to clipboard
Link copied to clipboard
open override val notifyUserChange: (change: Map<String, Any>) -> Unit
Link copied to clipboard
open override val scope: CoroutineScope
Link copied to clipboard
open override val sdkContext: SdkContext
Link copied to clipboard
val seed: Int
Link copied to clipboard
open override val state: StateFlow<IdentityState>

Delegate state reads to the actor.

Link copied to clipboard
open override val storage: Storage
Link copied to clipboard
open override val tracker: suspend (TrackableSuperwallEvent) -> Unit
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val webPaywallRedeemer: () -> WebPaywallRedeemer

Functions

Link copied to clipboard
Link copied to clipboard
fun configure(neverCalledStaticConfig: Boolean)
Link copied to clipboard
open fun delete(storable: Storable<*>)

Delete a value from storage.

Link copied to clipboard

Fire-and-forget dispatch of a sub-action on this context's actor.

Link copied to clipboard
fun identify(userId: String, options: IdentityOptions? = null)
Link copied to clipboard
open suspend fun immediate(action: TypedAction<IdentityContext>)
Link copied to clipboard
open suspend fun immediateUntil(action: TypedAction<IdentityContext>, until: (IdentityState) -> Boolean)
Link copied to clipboard
fun mergeUserAttributes(newUserAttributes: Map<String, Any?>, shouldTrackMerge: Boolean = true)
Link copied to clipboard
open fun <T : Any> persist(storable: Storable<T>, value: T)

Persist a value to storage.

Link copied to clipboard
open fun <T : Any> read(storable: Storable<T>): Result<T>
Link copied to clipboard
fun reset()
Link copied to clipboard
open fun sideEffect(what: suspend () -> Unit)
Link copied to clipboard
open fun track(event: TrackableSuperwallEvent)
Link copied to clipboard
open override fun update(reducer: Reducer<IdentityState>)

Apply a state reducer inline.