Menu

Native App & H5 Connection

     In certain scenarios, it is common to integrate H5 (HTML5) pages within a mobile app to achieve fast deployment and updates. However, due to technical limitations, the mobile app is unable to directly access and track event data occurring on the H5 page. To ensure data consistency between the mobile app and the H5 page, the SE SDK enables the data connection function.

Function

public void setJsBridge(WebView webView)
ParameterDescriptionTypeRequired
webViewAndroid Webview widgetWebView Yes

Sample Code

import com.reyun.solar.engine.SolarEngineManager;

private WebView webView;

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        webView = findViewById(R.id.webview);
        //Note that this method should be called before webview loadUrl.
        SolarEngineManager.getInstance().setJsBridge(webView);
        webView.loadUrl("H5 page that needs loading");
    }


Previous
Calculate Event Duration
Next
Deep Linking
Last modified: 2024-12-03Powered by