Background: For all customers integrating DiDi BNPL H5, the container configuration must be aligned to avoid unexpected issues when launching the DiDi H5 page, which could otherwise affect the Merchant's transaction success rate.
Supported environments: iOS native and Android native only. Not applicable to web versions, Linux, or other Windows systems. The intended audience of this document is the Merchant App's web-container configuration and check methods.
What "container" means here: In this document, "container" refers to the way the Merchant App opens web pages:
- Android WebView / Custom Tabs, or
- iOS WKWebView / SFSafariViewController.
1. Android App Self-Check: Code and Configuration Check
Only check the Activity/Fragment that actually hosts our H5 — do not just look at the public WebView base class or template code. First confirm the container type, then check the corresponding subsection.
1.1 Confirm the Container Type First
Note: Based on historical reports from different providers, Custom Tabs may trigger external redirection, causing flow anomalies. Custom Tabs is not recommended.
1.2 System and Web Permissions
1.3 WebView Basic Configuration
1.4 Page URL, Navigation and Functions
1.5 Page Lifecycle and Version
1.6 Android Custom Tabs (Not Recommended)
Custom Tabs is hosted by a browser provider; the Merchant App usually cannot read or modify the WebChromeClient, WebSettings, or media callbacks of its internal WebView.
What needs to be confirmed:
- The browser/provider used, its version, and the Android system version;
- System camera permission and browser permission are available;
- The HTTPS page and the real face-verification flow can be completed.
Do not require Custom Tabs to provide onPermissionRequest logs of a self-built WebView.
2. iOS App Self-Check: Code and Configuration Check
Only check the ViewController/WKWebView that actually hosts our H5.
First confirm the container type, then check the corresponding subsection.
2.1 Confirm the Container Type First
2.2 System and Web Permissions
2.3 Video Display Configuration
2.4 Page URL, Navigation and Resources
2.5 Page Lifecycle and Version
2.6 iOS SFSafariViewController
The internal page of SFSafariViewController is hosted by the system browser; the Merchant App cannot configure allowsInlineMediaPlayback, WKUIDelegate, or internal media callbacks. The Merchant only needs to provide the system version and App version and complete the real face-verification acceptance; if the screen behaves abnormally, troubleshoot by system browser/version and the actual observed behavior.
3. Merchant App JSBridge Environment Information (Suggested)
JSBridge is not a hard requirement for the H5 to open and complete authentication.
However, DiDi strongly recommends that the Merchant App implement JSBridge to provide a stable method that lets the DiDi H5 quickly read the native container parameters when a problem occurs, for fast diagnosis.
Android and iOS use the same return structure; the H5 does not need to parse two different formats.
3.1 Applicable Stage
Before face verification: the DiDi H5 obtains the Merchant App information.
The Merchant App native layer sets up JSBridge so that the DiDi H5 can obtain container-related information, enabling fast problem localization when issues occur, helping the Merchant App resolve them, and improving PSR.
H5 (DiDi) --calls JSBridge--> Merchant App native layer
<--returns JSON-- (container type / system version / permission status / WebView version ...)
3.2 Unified Return Format
Android example:
{
"code": "OK",
"data": {
"system": "Android",
"systemVersion": "15",
"appVersion": "1.1",
"containerType": "WEBVIEW",
"permissions": {
"camera": {
"native": "GRANTED",
"web": "GRANTED"
},
"microphone": {
"native": "NOT_REQUESTED",
"web": "NOT_REQUESTED"
}
},
"webView": {
"provider": "com.google.android.webview",
"version": "131.0.6778.81"
},
"webViewConfig": {
"javaScriptEnabled": true,
"domStorageEnabled": true,
"allowsInlineMediaPlayback": null,
"mediaPlaybackRequiresUserGesture": true
}
}
}
The same structure is used for iOS:
{
"code": "OK",
"data": {
"system": "iOS",
"systemVersion": "26.0",
"appVersion": "1.1",
"containerType": "WKWEBVIEW",
"permissions": {
"camera": {
"native": "GRANTED",
"web": "GRANTED"
},
"microphone": {
"native": "NOT_REQUESTED",
"web": "NOT_REQUESTED"
}
},
"webView": {
"provider": "WKWebView",
"version": "26.0"
},
"webViewConfig": {
"javaScriptEnabled": true,
"domStorageEnabled": true,
"allowsInlineMediaPlayback": true,
"mediaPlaybackRequiresUserGesture": null
}
}
}
3.3 Fields and States
Permission states uniformly use: GRANTED, DENIED, NOT_REQUESTED, UNKNOWN, NOT_APPLICABLE.
3.4 Platform Boundaries
-
allowsInlineMediaPlaybackis an iOS WKWebView configuration; Android has no same-named configuration and returnsnull— do not fabricate a value. -
mediaPlaybackRequiresUserGestureis mainly used on Android; on iOS where it is not applicable, returnnull. -
For
CUSTOM_TABSandSFSafariViewController, WebView configurations and web permissions that cannot be read returnUNKNOWNorNOT_APPLICABLE. -
The Bridge query must not actively request permissions, pop up dialogs, or invoke the camera.
-
The environment query in 3.2 only returns the container, version, and permission status.
-
The JSBridge method name, invocation method, and async callback method are agreed between the two parties during integration.
4. Final Outcome
4.1 The Final Outcome to Achieve
This section does not require reviewing code. After embedding our H5 into the merchant's App, the following outcomes must be achieved.
4.2 Review of the Merchant App Container Environment's Current State
This section does not make a pass/fail judgment; it only records the actual behavior of our H5's face flow when interacting with camera permissions in the merchant's App, as a basis for subsequent troubleshooting and adaptation. Please test each item and fill it in truthfully, marking unknown items as "To be confirmed"; record iOS and Android, and different containers, separately.
Please test the three scenarios separately — "first-time not authorized", "re-entry after denial", and "return after authorizing in the settings page" — recording the operation steps and whether the flow jumps out of the current App/container, to avoid judging the actual experience solely by "camera permission is supported".