Skip to main content

WebViewResultObserver

If you were looking for the method for use with Unity, see WebViewResultObserver for Unity SDK.

Register the callback of the Player Network SDK WebView module, the game needs to process the callback function. For more information on the callback data structure, see WebviewResult.

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 SetWebViewResultObserver(FINTLWebViewEvent& callback);
//get callback
FINTLWebViewEvent& GetWebViewResultObserver();

Unreal Engine event handling

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "INTLSDKObserver")
void OnWebViewResult(FINTLWebViewResult ret);
virtual void OnWebViewResult_Implementation(FINTLWebViewResult ret) {};

Code sample

C++ event handling (above V1.15)

//configure callback
FINTLWebViewEvent webViewEvents;
webViewEvents.AddUObject(this, &OnWebViewResult_Implementation);
UINTLSDKAPI::SetWebViewResultObserver(webViewEvents);
// Remove callbacks
UINTLSDKAPI::GetWebViewResultObserver().Clear();
void OnWebViewResult_Implementation(FINTLWebViewResult ret)
{
UE_LOG(LogTemp, Warning, TEXT("MethodID: %d"), ret.MethodId);
}

Unreal Engine event handling

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