Manual Login

Logging in the User

White label login works a little differently than other platforms in the sense that we first have to create a white label login session, which is then used to create a game session.

When the player is logged in, the SDK will save the token, so you don't have to send it to StartWhiteLabelSession

// Remember to use the LootLocker namespace in the top of your file.
using LootLocker.Requests;

// This code should be placed in a handler when user clicks the login button.
string email = "user@lootlocker.io";
string password = "password here";
bool rememberMe = true;
LootLockerSDKManager.WhiteLabelLogin(email, password, rememberMe, response =>
{
    if (!response.success)
    {
        Debug.Log("error while logging in");
        return;
    }

    string token = response.SessionToken;
    
    // Start game session here
});

Register a Game Session

After creating a session token we can register a game session. When the session has been registered you can use other LootLocker features in your game.

// Remember to use the LootLocker namespace in the top of your file.
using LootLocker.Requests;

// This code should be placed in a handler when user clicks login button.
LootLockerSDKManager.StartWhiteLabelSession((response) =>
{
    if (!response.success)
    {
        Debug.Log("error starting LootLocker session");

        return;
    }

    Debug.Log("session started successfully");
});

Last updated