Skip to main content

GUAIDTokenResultObservers [Player Network SDK only]

Register the callback for the login module, the game needs to handle the callback.For more information on the callback data structure, refer to the following data structure GUAIDTokenResult.

note

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

Data structure

GUAIDTokenResult: Inherits from GUABaseResult.

ParametersTypeDescription
IdTokenstringPlayer Network SDK Unique OpenID
Defaults to a string representing a 64-bit unsigned integer, but 32-bit is also supported.

Function Definition

// IDTokenEvents callback event, used to handle the callback of QueryIDToken
event OnResultHandler<GUAIDTokenResult> IDTokenEvents;

Code Example

// Add callback
UnionAdapterAPI.GetAccountService().IDTokenEvents += OnIDTokenEvent;

// Remove callback
UnionAdapterAPI.GetAccountService().IDTokenEvents -= OnIDTokenEvent;

// Callback handler for IDTokenEvents
public void OnIDTokenEvent(GUAIDTokenResult idtokenret)
{
Debug.Log("OnIDTokenEvent in Auth");
}