# Android Webview

## [WebView Integration (Required when using WebViews)](https://docs.forter.com/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](https://developer.android.com/reference/android/webkit/WebView.html "WebView") is ready, please call our WebViewIntegration with your WebView's instance.

### Java
```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](https://docs.forter.com/mobile-sdks/android-webview#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](https://docs.forter.com/mobile-sdks/android-webview#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](https://docs.forter.com/mobile-sdks/android-webview#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](https://docs.forter.com/mobile-sdks/android-webview#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
```json
{
  "orderType": "WEB",
  "eventTime": 1648651702558,
  "connectionInformation": {
    "customerIP": "12.182.159.90.51072",
    "forterTokenCookie": "30867f63af3542cb97881066f290bd",
    "userAgent": "teststore/21.1211 CFNetwork/1329 Darwin/21.3.0"
  }
}
```
