Skip to main content

GUAConnectResultObservers [MSDK Only]

Register the login module callback; the game needs to handle the callback.For more information on the callback data structure, see the following data structure: GUALoginResult.

note

[MSDK Only] It is strongly recommended that the game registers the callback in the application’s startup function.

Function Definition

// ConnectRetEvents callback, Kwai channel only
event OnResultHandler<GUALoginResult> ConnectRetEvents;

Code Example

// Add callback
UnionAdapterAPI.GetAccountService().ConnectRetEvents += mLoginCallBack.OnConnectRetEvent;

// Remove callback
UnionAdapterAPI.GetAccountService().ConnectRetEvents -= mLoginCallBack.OnConnectRetEvent;

// Handling for ConnectRetEvents callback
public void OnConnectRetEvent(GUALoginResult loginRet)
{
Debug.Log("OnConnectRetNotify in login");
string methodTag = "";
if (loginRet.MethodId == (int)GUAMethodID.GUA_ACCOUNT_CONNECT)
{
methodTag = "Connect";
}

mCurrentTestMgr.ShowLogInNewLine(methodTag + loginRet);
}