Use the front-facing camera
By default, BlinkID uses the rear-facing camera. For kiosk-style applications where a tablet or similar device is mounted and the user holds their document up to the screen, configure the SDK to use the front-facing camera instead.
Set the front-facing camera
- Web (TS)
- Android (Kotlin)
- iOS (Swift)
note
This option is not supported when using the all-in-one
blinkid package.
Use the
camera-manager
package and build your own scanning flow using the lower-level API.
Pass preferredFacing: "front" when starting the video stream:
import { CameraManager } from "@microblink/camera-manager";
const cameraManager = new CameraManager();
await cameraManager.startCameraStream({
preferredFacing: "front",
});
See the camera selection example app for a complete integration example.
Pass CameraSettings with lensFacing set to CameraLensFacing.LensFacingFront:
BlinkIdCameraScanningScreen(
blinkIdSdk = blinkIdSdk,
cameraSettings = CameraSettings(
lensFacing = CameraLensFacing.LensFacingFront,
),
onScanningSuccess = { result ->
// use result
},
onScanningCanceled = { }
)
Pass ScanningUXSettings with preferredCameraPosition set to .front via the .uxSettings() modifier:
BlinkIDUXView(
analyzer: analyzer,
onScanCompleted: { resultState in
guard let result = resultState.scanningResult else { return }
// use result
}
)
.uxSettings(ScanningUXSettings(preferredCameraPosition: .front))