Webview Integrations
Webviews and integrated browsers on native apps
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. Your specific Forter JS snippet can be found in your Forter portal. The Webview integration solution places the mobileUid
in a global JS variable that is later collected by the Forter javaScript script.
WKWebview
Forter will provide a specific script that will be executed AFTER the WKWebView is initiated. For the official developer documentation on iOS WKWebView embedding and best practices, click (here)https://developer.apple.com/documentation/webkit/wkwebview
HYBRID APPS WITH WEB BROWSER CHECKOUT PAGE
In the case of Hybrid apps where the checkout page is a web browser, both the SDK webview method should be called AND the Forter JavaScript snippet should be placed in your web page's HTML. In cases of webview or web-based checkout pages, the backend API request should have orderType
of the request body should have an "WEB"
and NOT mobile so that Forter data models understand that the order was placed on a mobile WEB browser and not a native mobile screen.
Example Webview Order Request
Note the orderType is
WEB
and the request populates theforterTokenCookie
field instead of theforterMobileUID
{
"orderType": "WEB",
"eventTime": 1648651702558,
"connectionInformation": {
"customerIP": "12.182.159.90.51072",
"forterTokenCookie": "30867f63af3542cb97881066f290bd", // generated by the Forter JS script NOT the SDK
"userAgent": "teststore/21.1211 CFNetwork/1329 Darwin/21.3.0"
},
Updated 6 months ago