Skip to main content

Callback for Player Network SDK login module (IDTokenResultObserver)

If you are using the Unity engine, see Unity SDK's IDTokenResultObserver.

Register the callback for the Player Network SDK login module. The game needs to handle the callback.For more details about callback data structures, see IDTokenResult.

note

It is strongly recommended that games register during the application start-up function.

Function definition

C++ Event Handling Method (Above V1.15)

//Configure callback
void SetIDTokenResultObserver(FINTLIDTokenEvent& callback);
//Get callback
FINTLIDTokenEvent& GetIDTokenResultObserver();

Unreal Engine Event Handling

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "INTLSDKObserver")
void OnIDTokenResult(FINTLIDTokenResult ret);
virtual void OnIDTokenResult_Implementation(FINTLIDTokenResult ret) {};

Code example

C++ Event Handling Method (Above V1.15)

//Configure callback
FINTLIDTokenEvent tokenEvent;
tokenEvent.AddUObject(this, &OnIDTokenResult_Implementation);
UINTLSDKAPI::SetIDTokenResultObserver(tokenEvent);
//Clear callback
UINTLSDKAPI::GetIDTokenResultObserver().Clear();
void OnIDTokenResult_Implementation(FINTLIDTokenResult ret)
{
UE_LOG(LogTemp, Warning, TEXT("MethodID: %d"), ret.MethodId);
}

Unreal Engine Event Handling

void OnIDTokenResult_Implementation(FINTLIDTokenResult ret)
{
UE_LOG(LogTemp, Warning, TEXT("MethodID: %d"), ret.MethodId);
}