ProjectVGuestIdentityProvider class
The standard Guest ID source: it creates a random ID once and keeps it on this device, so the player gets the same Guest account on every launch. The ID is not a secret. Uninstalling the game or clearing its data loses the ID and with it the Guest account.
Namespace: SilverTiger.ProjectV.Unity.Presentation.Authentication
public sealed class ProjectVGuestIdentityProvider : IProjectVGuestIdentityProvider
Constructors
ProjectVGuestIdentityProvider()
Creates the Guest ID source for this device.
public ProjectVGuestIdentityProvider();
Methods
GetOrCreateAsync(CancellationToken cancellationToken)
Returns this device's saved Guest ID, or creates and saves a new one when none is saved yet. Call it on the Unity main thread.
public Task<string> GetOrCreateAsync(CancellationToken cancellationToken);
Parameters
| Name | Type | Description |
|---|---|---|
cancellationToken | CancellationToken | Cancels the call before it starts. |
Returns
Task<string>: The Guest ID; never empty. Pass it to IProjectVAuthenticationPresenter.AuthenticateDeviceAsync.
Exceptions
| Exception | When |
|---|---|
OperationCanceledException | cancellationToken was already cancelled. |