core / com.schibsted.account.util / KeyValueStore

KeyValueStore

open class KeyValueStore

DAO for sdk-related shared preferences.

Constructors

<init>

KeyValueStore(context: Context)

Constructor.

Functions

clear

open fun clear(): Unit

Clears all preferences in the file

clearAccessToken

open fun clearAccessToken(): Unit

Clears the currently stored access token.

clearEmailPrefillValue

open fun clearEmailPrefillValue(): Unit

readAccessToken

open fun readAccessToken(): TokenResponse?

Reads the stored access token, if a valid one is stored.

readAccessTokenCompat

open fun readAccessTokenCompat(clientSecret: String!): TokenResponse?

Reads the stored access token, if a valid one is stored.

readAuthCode

open fun readAuthCode(): String?

Gets the last auth code provided to the sdk

readClientAccessToken

open fun readClientAccessToken(): TokenResponse?

Reads the stored client token, if a valid one is stored.

readConnection

open fun readConnection(): String?

Gets the currently active connection type

readEmailPrefillValue

open fun readEmailPrefillValue(): String?

readPasswordlessToken

open fun readPasswordlessToken(): PasswordlessToken?

Reads the stored passwordless token, if a valid one is stored.

writeAccessToken

open fun writeAccessToken(jsonWebToken: TokenResponse!): Unit

Stores an access token.

writeAuthCode

open fun writeAuthCode(authCode: String!): Unit

Sets the last auth code provided to the sdk

writeClientToken

open fun writeClientToken(clientCredentials: TokenResponse!): Unit

Stores a token representing client credentials.

writeConnection

open fun writeConnection(connection: String!): Unit

Writes the currently active connection type

writeEmailPrefillValue

open fun writeEmailPrefillValue(email: String!): Unit

writePasswordlessToken

open fun writePasswordlessToken(passwordlessToken: PasswordlessToken!): Unit

Stores a passwordless token.