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

◆ TransferAccountWithIdPLogin()

static void TransferAccountWithIdPLogin ( string accountId,
string accountPassword,
GamebaseCallback::GamebaseDelegate< GamebaseResponse::Auth::AuthToken > callback )
static

Try to transfer account with transfer account id and password.

If this process is finished successfully, it proceeds login process and return AuthToken.

Since
Added 2.2.0.
Parameters
accountIdTransferAccount id received from old device.
accountPasswordTransferAccount password from old device.
callbackCallbacks the result of TransferAccountWithIdPLogin

Example Usage :

public void TransferAccountWithIdPLoginSample(string accountId, string accountPassword)
{
Gamebase.TransferAccountWithIdPLogin(accountId, accountPassword, (authToken, error) =>
{
if (Gamebase.IsSuccess(error) == true)
{
Debug.Log("TransferAccountWithIdPLogin succeeded.");
}
else
{
// Check the error code and handle the error appropriately.
var log = new StringBuilder();
log.AppendLine(string.Format("TransferAccountWithIdPLogin failed. error is {0}", error));
if (error.code == GamebaseErrorCode.AUTH_TRANSFERACCOUNT_BLOCK)
{
GamebaseResponse.Auth.TransferAccountFailInfo transferAccountFailInfo = GamebaseResponse.Auth.TransferAccountFailInfo.From(error);
if (transferAccountFailInfo != null)
{
log.AppendLine("---TransferAccountFailInfo---");
log.AppendLine(GamebaseJsonUtil.ToPrettyJsonString(transferAccountFailInfo));
}
}
Debug.Log(log);
}
});
}
static void TransferAccountWithIdPLogin(string accountId, string accountPassword, GamebaseCallback.GamebaseDelegate< GamebaseResponse.Auth.AuthToken > callback)
Try to transfer account with transfer account id and password.
Definition Gamebase.cs:1607
static bool IsSuccess(GamebaseError error)
Return true if the GamebaseException object is null or the error code is zero.
Definition Gamebase.cs:57
The Gamebase class is core of Gamebase service.
Definition Gamebase.cs:11