Skip to main content

GUAConnectResultObservers [MSDK Only]

Registers the callback of the Auth module, the game needs to process the callback function. For more information on the callback data structure, see GUALoginResult.

note

It is strongly recommended to perform registration in the startup function of the game application.[MSDK Only].

Function Definition

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

Code Sample

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

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

// 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);
}