LoginWithXbox
method in Coherence.Cloud.CoherenceCloud
Methods
public static LoginOperation LoginWithXbox(string token, CancellationToken cancellationToken = default)
Login to coherence Cloud using an Xbox profile.
Parameters
| Type | Name | Description |
|---|---|---|
| string | token | Xbox Live Token provided by the Xbox Live SDK method GetTokenAndSignatureAsync. |
| CancellationToken | cancellationToken | Used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| LoginOperation | The status of the asynchronous login operation. |
Remarks
'Xbox Auth Enabled' must be ticked in Project Settings on your Online Dashboard for this authentication method to be usable.
Examples
using System.Threading.Tasks;
using Coherence.Cloud;
using UnityEngine;
class LoginWithXbox : MonoBehaviour
{
public async Task<PlayerAccount> Login(string token)
{
PlayerAccount playerAccount = await CoherenceCloud.LoginWithXbox(token);
Debug.Log($"Logged in as: {playerAccount}.");
return playerAccount;
}
}