🆕 Online Onboarding - Troubleshooting for Developers
WebView Requirements for Camera, Video & Likeness Checks
1. Introduction
As part of Lemonway’s Online Onboarding, merchants are asked to complete identity verification steps, which include:
- Taking a photo of their ID document
- Recording a selfie or short video for likeness verification
- Uploading supporting documents directly from their camera or photo library
These steps rely on camera and media playback. If you embed the onboarding form inside a mobile WebView (rather than a normal browser), you must configure that WebView correctly.
If not configured, end-users will experience:
- The camera not opening
- Video not starting
- Endless loading screens (“spinner”)
- Failed verification
This guide explains the minimum WebView configuration required on iOS and Android.
2. iOS (WKWebView) Requirements
Settings
- Enable inline media playback (video and camera run inside the WebView).
- Do not require user interaction (tap to play).
App Permissions (Info.plist
)
Info.plist
)Add clear descriptions for:
NSCameraUsageDescription
NSMicrophoneUsageDescription
NSPhotoLibraryUsageDescription
Example (Swift)
let config = WKWebViewConfiguration()
config.allowsInlineMediaPlayback = true
config.mediaTypesRequiringUserActionForPlayback = []
let webView = WKWebView(frame: .zero, configuration: config)
3. Android (WebView) Requirements
Manifest Permissions
In AndroidManifest.xml
, declare:
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
WebView Settings
- Allow JavaScript.
- Allow media playback without requiring a tap.
- Handle camera/microphone permission requests.
Example (Kotlin/Java)
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setMediaPlaybackRequiresUserGesture(false);
webView.setWebChromeClient(new WebChromeClient() {
@Override
public void onPermissionRequest(PermissionRequest request) {
request.grant(request.getResources());
}
});
4. Troubleshooting
If merchants report issues such as:
- Camera not opening
- Video not recording
- Onboarding stuck with a spinner
Check the following:
- Inline media playback is enabled.
- Camera/microphone permissions are granted.
- You are running in a secure context (HTTPS).
- Your WebView handles
onPermissionRequest
correctly (Android). - App settings include the required usage descriptions (iOS).
5. Summary
To ensure a smooth onboarding experience inside your app:
-
On iOS:
- Allow inline media playback.
- Do not require tap to play.
- Add camera/microphone usage descriptions in
Info.plist
.
-
On Android:
- Add camera + internet permissions in
AndroidManifest.xml
. - Allow media playback without user gestures.
- Implement permission handling in WebView.
- Add camera + internet permissions in
Recommendation: Always test the onboarding flow on real devices (both iOS and Android) before releasing to production.
6. Authentication with OAuth (Optional but Recommened)
When embedding Lemonway’s Online Onboarding inside a WebView, you may also want to handle user authentication securely.
-
Lemonway supports OAuth2 flows, where a short-lived access token is exchanged for secure onboarding sessions. See: OAuth
-
Using OAuth ensures:
- The onboarding session is linked to the correct user/wallet.
- Sensitive data (e.g. KYC documents, video likeness) is submitted securely.
- Tokens can expire and be refreshed, reducing security risks.
Best Practices
- Use OAuth2 Authorization Code Flow (with PKCE if mobile).
- Handle token expiry gracefully — refresh before expiry to avoid onboarding being interrupted.
- Never hardcode tokens in the mobile app.
- If you embed onboarding in a WebView, pass the OAuth access token in the Authorization header or as part of the onboarding session request (per Lemonway API).
Updated about 3 hours ago