Skip to main content

Callback of the Player Network SDK WebView module (WebViewResultObserver)

If you are using Unreal Engine, see WebViewResultObserver for Unreal Engine SDK.

Register the callback for the WebView module; the game needs to register the callback for processing.For more information about the callback data structure, see WebviewResult.

note

It is strongly recommended that games register during the application start-up function.

Function definition

// Add INTLWebViewResult callback
public static void AddWebViewResultObserver(OnINTLResultHandler<INTLWebViewResult> callback);
// Remove INTLWebViewResult callback
public static void RemoveWebViewResultObserver(OnINTLResultHandler<INTLWebViewResult> callback);

Code sample

// Add callback
public void AddWebViewObserver()
{
INTLAPI.AddWebViewResultObserver(OnWebViewRetEvent);
}

// Remove callback
public void RemoveWebViewObserver()
{
INTLAPI.RemoveWebViewResultObserver(OnWebViewRetEvent);
}

// Callback handling of INTLWebViewResult
public void OnWebViewRetEvent(INTLWebViewResult ret)
{
Debug.Log($"MethodID: {ret.MethodId}");
}