token
The stable anonymous user token.
Lazily generates a unique UUID string on first access, durably commits it to disk, and caches it in memory for fast subsequent access.
This getter is thread-safe and process-safe: concurrent first callers in the same process receive the identical token, and the token is synchronously committed to disk to survive immediate process termination.
Example:
val store = UserTokenStore.create(context)
val userToken = store.token // e.g. "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"Content copied to clipboard