IDTokenResultObserver
Registers the callback of the Player Network SDK Auth module, the game needs to process the callback function. For more information on the callback data structure, see IDTokenResult.
note
It is strongly recommended to perform registration in the startup function of the game application.
Function definition
C++ event handling (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 sample
C++ event handling (above V1.15)
//configure callback
FINTLIDTokenEvent tokenEvent;
tokenEvent.AddUObject(this, &OnIDTokenResult_Implementation);
UINTLSDKAPI::SetIDTokenResultObserver(tokenEvent);
// Remove callbacks
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);
}