Callback of the Notification Module (NoticeResultObserver)
If you are using the Unity engine, please refer to NoticeResultObserver for the Unity SDK.
Register the callback for the Player Network SDK notification module; the game needs to register the callback for handling.For more information on callback data structure, see NoticeResult.
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 SetNoticeResultObserver(FINTLNoticeEvent& callback);
// Retrieve callback
FINTLNoticeEvent& GetNoticeResultObserver();
Unreal Engine Event Handling
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "INTLSDKObserver")
void OnNoticeResult(FINTLNoticeResult ret);
virtual void OnNoticeRequestData_Implementation(FINTLNoticeResult ret) {};
Code example
C++ Event Handling Method (Above V1.15)
// Configure callback
FINTLNoticeEvent noticeEvent;
noticeEvent.AddUObject(this, &OnNoticeRequestData_Implementation);
UINTLSDKAPI::SetNoticeResultObserver(noticeEvent);
// Clear callback
UINTLSDKAPI::GetNoticeResultObserver().Clear();
void OnNoticeRequestData_Implementation(FINTLNoticeResult ret)
{
UE_LOG(LogTemp, Warning, TEXT("MethodID: %d"), ret.MethodId);
}
Unreal Engine Event Handling
void OnNoticeRequestData_Implementation(FINTLNoticeResult ret)
{
UE_LOG(LogTemp, Warning, TEXT("MethodID: %d"), ret.MethodId);
}