iOS Webview - Mobile SDKs

iOS SDK

iOS Webview

Overview Overview

For apps that incorporate hybrid or mobile browsers, Forter offers a webview integration solution. As part of the webview integration, please make sure to also include the Forter JavaScript for webview/browser-based components of your app. The Forter JS snippet code and extensive information can be found in Front-end Integration.

This call places the mobileUid in a global JS variable (inside the WKWebView) which is later collected by our JavaScript.

WKWebView WKWebView

After the WKWebView is initialized please execute the following code:

[wkWebview evaluateJavaScript:[FTRWebViewIntegration getJSCodeForEval] completionHandler:NULL];

Official developer documentation for iOS WKWebView embedding can be found here

Hybrid Apps with Web Browser Checkout page 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 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 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 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.

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