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)
Parameter | Description | Type | Required |
---|---|---|---|
webView | Android Webview widget | WebView | 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");
}