Detect faces in real time using Apple Vision (iOS) or Google ML Kit (Android).
Android Requirement: Requires a Google Play Store device. To avoid a delay on the first run, you should pre-download the ML Kit model by adding the following to your AndroidManifest.xml:
<application ...>
<meta-data
android:name="com.google.mlkit.vision.DEPENDENCIES"
android:value="face" />
</application>
Use onFaceDetected to receive an array of FaceData objects containing id, yaw, pitch, roll, and bounding box information.
<Camera
...
faceDetectionEnabled={true}
faceDetectionThrottleMs={100} // optional, default 100ms
onFaceDetected={(event) => {
// event.nativeEvent.faces: FaceData[]
// each face: { id, yaw, pitch, roll, boundsX, boundsY, boundsWidth, boundsHeight }
}}
// Android only — track MLKit face module download progress
onFaceDetectionInstallStatus={(event) => {
// event.nativeEvent.state: FaceDetectionInstallState
// 'pending' | 'downloading' | 'installing' | 'ready' | 'failed' | 'unavailable'
}}
/>