TokenStore

public protocol TokenStore

Defines an interface for managing token.

  • Retrieves current token information

    Declaration

    Swift

    func read(completion: @escaping (Result<TokenInfo, Error>) -> Void)

    Parameters

    completion

    Returns either valid token information or an error

  • Sets new token data

    Declaration

    Swift

    func write(tokenInfo: TokenInfo, completion: @escaping (Result<Void, Error>) -> Void)

    Parameters

    tokenInfo

    Token with it’s additional information.

    completion

    Returns either empty result in case of success or an error.

  • Removes a token

    Declaration

    Swift

    func clear(completion: @escaping (Result<Void, Error>) -> Void)

    Parameters

    completion

    Returns either empty result in case of success or an error.