Chuyển tới nội dung chính

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

NameTypeDescription
cancellationTokenCancellationTokenCancels the call before it starts.

Returns

Task<string>: The Guest ID; never empty. Pass it to IProjectVAuthenticationPresenter.AuthenticateDeviceAsync.

Exceptions

ExceptionWhen
OperationCanceledExceptioncancellationToken was already cancelled.