Gamebase SDK for Unity 2.69.0
Toast Gamebase Platform
Loading...
Searching...
No Matches

◆ Login() [3/3]

static void Login ( string providerName,
GamebaseCallback::GamebaseDelegate< GamebaseResponse::Auth::AuthToken > callback )
static

Try to authenticate by specifying an IdP type.

Types that can be authenticated are declared in the GamebaseAuthProvider class.

Since
Added 1.4.0.
Parameters
providerNameThe provider name witch is authentication provider.
callbackLogin result callback, returns the authentication token as a result of login.

Example Usage :

public void LoginSample()
{
Gamebase.Login(GamebaseAuthProvider.XXX, (authToken, error) =>
{
if (Gamebase.IsSuccess(error) == true)
{
if(authToken.member.temporaryWithdrawal != null)
{
long gracePeriodDate = authToken.member.temporaryWithdrawal.gracePeriodDate;
Debug.Log(string.Format("User is under temporary withdrawa. GracePeriodDate : {0}", error));
} <br>
else
{
string userId = authToken.member.userId;
Debug.Log(string.Format("Login succeeded. Gamebase userId is {0}", userId));
}
}
else
{
// Check the error code and handle the error appropriately.
Debug.Log(string.Format("Login failed. error is {0}", error));
if (error.code == GamebaseErrorCode.BANNED_MEMBER)
{
GamebaseResponse.Auth.BanInfo banInfo = GamebaseResponse.Auth.BanInfo.From(error);
if (banInfo != null)
{
}
}
}
});
}
static void Login(string providerName, GamebaseCallback.GamebaseDelegate< GamebaseResponse.Auth.AuthToken > callback)
Try to authenticate by specifying an IdP type.
Definition Gamebase.cs:611
The Gamebase class is core of Gamebase service.
Definition Gamebase.cs:11