Skip to main content

Push module callback (PushBaseResultObserver)

If you are using the Unity engine, please refer to Unity SDK's PushBaseResultObserver here.

Register the callback for the Player Network SDK Push module; the game needs to register the callback for handling.For more information about callback data structure, see BaseResult.

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 SetPushBaseResultObserver(FINTLPushBaseEvent& callback);
// Get callback
FINTLPushBaseEvent& GetPushBaseResultObserver();

Unreal Engine Event Handling

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "INTLSDKObserver")
void OnPushBaseResult(FINTLBaseResult ret);
virtual void OnPushBase_Implementation(FINTLBaseResult ret) {};

Code example

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

// Configure callback
FINTLPushBaseEvent pushBaseEvent;
pushBaseEvent.AddUObject(this, &OnPushBase_Implementation);
UINTLSDKAPI::SetPushBaseResultObserver(pushBaseEvent);
// Clear callback
UINTLSDKAPI::GetPushBaseResultObserver().Clear();
void OnPushBase_Implementation(FINTLBaseResult ret)
{
UE_LOG(LogTemp, Warning, TEXT("MethodID: %d"), ret.MethodId);
}

Unreal Engine Event Handling

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