AttentionBefore proceeding with the hybrid app setup, install the Android SDK and Web SDK.
Handle Web SDK Commands with the Android SDK
The Android SDK can handle the commands related to event transmission, device settings, and user settings carried out by the Web SDK. Configure theAirbridge.setWebInterface function before displaying the website in the web view.
YOUR_WEB_TOKEN is the Web SDK token. You can find it on the [Settings]>[Tokens] page in the Airbridge dashboard.
Enable Deep Links in Web View
Add the Airbridge.click function to enable deep links in the web view. The web view does not inherently support deep links. Therefore, theAirbridge.click function must be configured so that the SDK can handle the deep link embedded in the tracking link.
The Airbridge.click function returns true when the input address is a tracking link. When the app is launched through that address, the onSuccess function is called. If there is no internet connection or a different app is launched, the onFailure function is called.
When the input address is not a tracking link, the Airbridge.click function returns false , and no further action is executed.
WebViewClient#shouldOverrideUrlLoading in the WebViewClient allows you to determine whether to continue or cancel loading a specific URL after it is detected. For more information, refer to the Android Developer Guide.
Airbridge.click function to send the webView#shouldOverrideUrlLoading result as true. This allows the Airbridge Android SDK to open the tracking link instead of the web view.
The URL host of Airbridge tracking links are abr.ge, YOUR_APP_NAME.airbridge.io, or a custom domain.
Attention
In-app web view event collection
In-app web view event collection
Note that with the hybrid app setup, events that occur in the in-app web view must be collected through the Web SDK only. If collected through the App SDK as well, event duplication will occur. If your in-app web view uses a live mobile website, utilize only the Web SDK for event collection.