Frictionless - Code

Simple code-only authentication [IDEN-Frictionless-03]

Below is the easiest and quickest way to provide authentication with Beamable. However, the following does not provide any cross-platform support. It will create a user and log them in with Beamable specifically for the current device.

The PlayerAccount contains the player's gamer tag, their alias, and any other third party credentials that may be associated with the player.

using Beamable;
using Beamable.Player;

public class SilentLogin 
{
    private BeamContext _beamContext;
    public PlayerAccount account;

    private async void Start()
    {
        _beamContext = BeamContext.Default;
        await _beamContext.OnReady;
        await _beamContext.Accounts.OnReady;
        account = _beamContext.Accounts.Current;
    }
}