Skip to main content

GUAIDTokenResultObservers [Player Network SDK 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 the following data structure GUAIDTokenResult.

note

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

Data Structures

GUAIDTokenResult: inherits from GUABaseResult.

ParameterTypeDescription
IdTokenstringPlayer Network SDK unique OpenID
Default: 64-bit unsigned integer string, also supports 32-bit.

Function Definition

// IDTokenEvents callback event, to process QueryIDToken callback
event OnResultHandler<GUAIDTokenResult> IDTokenEvents;

Code Sample

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

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

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