Table of Contents

Class PlayerPrefsTokenStorage

Thread-safe token storage that keeps tokens in-memory for background threads and queues PlayerPrefs writes to be flushed on the main thread. Call InitializeFromPlayerPrefs() on the main thread at startup (WitClientManager does this) and call FlushPendingWrites() periodically on the main thread (WitClientManager.Update does this).

public class PlayerPrefsTokenStorage : ITokenStorage
Inheritance
PlayerPrefsTokenStorage
Implements
Inherited Members

Methods

FlushPendingWrites()

Flush queued PlayerPrefs actions on main thread. Call from Update.

public static void FlushPendingWrites()

GetAccessTokenAsync()

public Task<string> GetAccessTokenAsync()

Returns

Task<string>

GetRefreshTokenAsync()

public Task<string> GetRefreshTokenAsync()

Returns

Task<string>

GetTokensAsync()

public Task<TokenResponse> GetTokensAsync()

Returns

Task<TokenResponse>

InitializeFromPlayerPrefs()

Read PlayerPrefs on main thread to prime the in-memory cache. Call from Awake on main thread.

public static void InitializeFromPlayerPrefs()

SignInAsync(TokenResponse)

public Task SignInAsync(TokenResponse tokens)

Parameters

tokens TokenResponse

Returns

Task

SignOutAsync()

public Task SignOutAsync()

Returns

Task