Android Webview - Mobile SDKs

Android Webview

WebView Integration (Required when using WebViews)

The Android WebView integration should be included if your app structure incorporates a browser or WebView within any screens of your native app (e.g., opening a web view during checkout within the mobile app).

Once your WebView is ready, please call our WebViewIntegration with your WebView's instance.

Java

WebViewIntegration.inject(webview);

This call places the mobileUid in a global JS variable (inside the WebView) which is later collected by our JavaScript (which should placed on every page of your native desktop code).

Hybrid Apps with Web Browser Checkout page

If your app's checkout page uses a WebView, use one of the above WebView methods in the SDK. Make sure that the Forter JavaScript is also located within the HTML of the checkout page so that the relevant behavioral and cyber data can be captured.

Send the ForterToken generated by the JavaScript

When an order is placed on a web-based checkout page (in a Hybrid mobile app) the API request should include the forterToken (generated by the Forter JavaScript) connectionInformation object of the API request and not the mobileUID generated by the Forter SDK.

Use WEB orderType

Additionally, when the API request is made to Forter, the orderType of the request body should have an enum value of "WEB" and not mobile so that our models understand that the order was placed on a mobile WEB browser and not a native mobile screen.

Example Hybrid Mobile Order Request

The example below outlines the format for an order that was placed on a hybrid web app with an integrated mobile browser as the checkout page.

Note the orderType and forterTokenCookie values in the request. A forterMobileUID is not included in Webview orders.

JSON

{
  "orderType": "WEB",
  "eventTime": 1648651702558,
  "connectionInformation": {
    "customerIP": "12.182.159.90.51072",
    "forterTokenCookie": "30867f63af3542cb97881066f290bd",
    "userAgent": "teststore/21.1211 CFNetwork/1329 Darwin/21.3.0"
  }
}