WebView module callback (WebViewResultObserver)
Register the callback for the WebView module; the game needs to register a callback to handle the event.For more information about callback data structure, refer to WebviewResult.
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 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 example
C++ Event Handling Method (Above V1.15)
// Configure callback
FINTLWebViewEvent webViewEvents;
webViewEvents.AddUObject(this, &OnWebViewResult_Implementation);
UINTLSDKAPI::SetWebViewResultObserver(webViewEvents);
// Clear callback
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);
}