What is a webview?
A WebView is a large-scale software component, enabling the use of web content within apps. Effectively, a WebView is a (headless) web browser that is embedded within an app.
General functionality
Webview Continuity is a feature that sends the consents from the app into the webview to prevent the banner display on the webpage presented on the webview.
This feature is only supported when the same configuration is used for both app and web! We recommend against using multiple configurations, as this scenario can produce multiple issues, ranging from technical (banner showing up) to compliance-related.
The code side of the functionality is covered on the feature overview in the technical section of this guide.
On all frameworks, the apps API getUserSessionData
should be used. This API outputs all consents into a string that web CMP or browser SDK can read.
Example of output of the getUserSessionData
:
{
"consents": [
{
"status": true,
"templateId": "H1Vl5NidjWX",
"timestamp": 1741266243000
},
{
"status": true,
"templateId": "eqo2713wfFmqSP",
"timestamp": 1741266243000
},
{
"status": true,
"templateId": "Jy6PlrM3",
"timestamp": 1741266243000
},
{
"status": true,
"templateId": "HkocEodjb7",
"timestamp": 1741266243000
},
{
"status": true,
"templateId": "lKKb_UKJv_9qwi",
"timestamp": 1741266243000
},
{
"status": true,
"templateId": "BJz7qNsdj-7",
"timestamp": 1741266243000
}
],
"controllerId": "2fee38108a8761014bea1a4cea31cee2b23d1f51ce5390e65fee8ef2ce175020",
"language": "en",
"tcf": null,
"ccpa": null
}
This string needs to be injected into the webview into ucMobileSdk
's getUserSessionData
.
For cases where your app uses WebViews, we provide a mechanism to inject a user session, so that the CMP on the WebView is not shown every time the user opens it.
To implement this feature the SDK offers the method getUserSessionData
, which returns a String (JSON) with the user session.
Flutter
Android
iOS
React Native
This feature is intended to be used with a single SettingsID
For seamless integration and support, it is imperative that the SDK utilized within your application employs the same SettingsID as the one implemented within the WebView. The utilization of divergent SettingsIDs between the SDK and WebView are not supported by the SDK.
WebView Banner and the Native SDK
When displaying a WebView and adhering to the provided instructions, it's important to note that any changes to consent made by the user within the Web banner will not automatically be reflected in the Native SDK. This means that if a user alters their consent settings, these changes won't be communicated back to the native environment of your application.
To ensure that your application's functionality remains unaffected by these potential discrepancies, it's crucial to implement a mechanism that re-synchronizes consent statuses whenever the WebView is dismissed. This proactive approach will help maintain consistency across your application's consent management processes.
Compatibility
User Session injection is only supported if your WebView is running version 1.4.0 or higher of the Usercentrics Browser SDK.
Debugging
Android devices (both simulators and real devices) can be debugged with a built-in Chrome inspector tool found under this URL: chrome://inspect/#devices
Differences between iOS and Android
Android typically allows webview debugging via Inspector.
On iOS, this feature is usually turned off altogether, but can be enabled via code. If requesting a debuggable API file to investigate any webview issues, we need to ensure that the webview specifically can be inspected via the Safari developer tools.
Comments
0 comments
Please sign in to leave a comment.