Gamebase SDK for Unity 2.75.1 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

  accountId | TransferAccount id received from old device.
  accountPassword | TransferAccount password from old device.
  callback | Callbacks 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);
}
});
}
Toast.Gamebase.Gamebase.TransferAccountWithIdPLogin
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:1636
Toast.Gamebase.Gamebase.IsSuccess
static bool IsSuccess(GamebaseError error)
Return true if the GamebaseException object is null or the error code is zero.
Definition: Gamebase.cs:57
Toast.Gamebase.Gamebase
The Gamebase class is core of Gamebase service.
Definition: Gamebase.cs:11