👂

Listeners

The Camera SDK consists of multiple event listeners. The details of these listeners and the events that they will throw will be discussed in more detail here.

During the whole lifecycle

These events can be thrown in any stage of the measurement

onFingerDetected

This event will fire when the presence of a finger is detected.
Flutter
React Native
FibriCheckView(
...
onFingerDetected: () => { ...your code here...},
...
),
<RNFibriCheckView
...
onFingerDetected={() => ...your code here...}
...
/>

onFingerRemoved

This event will fire when the presence of a finger is no longer detected.
Flutter
React Native
FibriCheckView(
...
onFingerRemoved: () => { ...your code here...},
...
),
<RNFibriCheckView
...
onFingerRemoved={() => ...your code here...}
...
/>

Pre-recording

These events will only be thrown when not recording

onFingerDetectionTimeExpired

This event will fire when the fingerDetectionExpiryTime has been exceeded. Note that the default time is set to -1, meaning that this event won't fire.
Flutter
React Native
FibriCheckView(
...
onFingerDetectionTimeExpired: () => { ...your code here...},
...
),
<RNFibriCheckView
...
onFingerDetectionTimeExpired={() => ...your code here...}
...
/>

onPulseDetected

This event will fire when a pulse has been detected. The pulse detection is only active after the finger detection has been completed.
Flutter
React Native
FibriCheckView(
...
onPulseDetected: () => { ...your code here...},
...
),
<RNFibriCheckView
...
onPulseDetected={() => ...your code here...}
...
/>

onPulseDetectionTimeExpired

This event will fire when no pulse has been detected after 10 seconds.
Flutter
React Native
FibriCheckView(
...
onPulseDetectionTimeExpired: () => { ...your code here...},
...
),
<RNFibriCheckView
...
onPulseDetectionTimeExpired={() => ...your code here...}
...
/>

onCalibrationReady

When performing a measurement, a baseline needs to be calculated. When this baseline has been calculated, the calibration is ready and the sdk will throw this event.
Flutter
React Native
FibriCheckView(
...
onCalibrationReady: () => { ...your code here...},
...
),
<RNFibriCheckView
...
onCalibrationReady={() => ...your code here...}
...
/>

onMeasurementStart

This event will fire when the recording of the measurement has been initiated.
Flutter
React Native
FibriCheckView(
...
onMeasurementStart: () => { ...your code here...},
...
),
<RNFibriCheckView
...
onMeasurementStart={() => ...your code here...}
...
/>

While recording

these events can be thrown while the measurement is recording

onHeartBeat

This event will fire when a heartbeat has been detected. It will return the heart rate as a number.
Flutter
React Native
FibriCheckView(
...
onHeartBeat: () => { ...your code here...},
...
),
<RNFibriCheckView
...
onHeartBeat={(heartRate: number) => ...your code here...}
...
/>

onSampleReady

This event will fire when a new sample is ready. It can be used the draw a graph or analyze data. For now, it's best to leave this event as is, because the JS bridge is not fast enough to handle this amount of data.
Flutter
React Native
FibriCheckView(
...
onSampleReady: () => { ...your code here...},
...
),
<RNFibriCheckView
...
onSampleReady={(data) => ...your code here...}
...
/>

onMovementDetected

This event will fire when movement has been detected. Note that this event will only fire when the movementDetectionEnabled property is enabled. This value is true by default.
Flutter
React Native
FibriCheckView(
...
onMovementDetected: () => { ...your code here...},
...
),
<RNFibriCheckView
...
onMovementDetected={() => ...your code here...}
...
/>

onTimeRemaining

This event will fire every second while recording. It returns the time in seconds that are left for completing the measurement. This is to make sure that no external timers are used, as they can become out of sync with the internal measurement timer.
Flutter
React Native
FibriCheckView(
...
onTimeRemaining: () => { ...your code here...},
...
),
<RNFibriCheckView
...
onTimeRemaining={(seconds: number) => ...your code here...}
...
/>

onMeasurementFinished

This event will fire when the recording is complete. The Post Processing will begin now.
Flutter
React Native
FibriCheckView(
...
onMeasurementFinished: () => { ...your code here...},
...
),
<RNFibriCheckView
...
onMeasurementFinished={() => ...your code here...}
...
/>

onMeasurementError

This event will fire when a measurement error occurs. The measurement will halt upon such an error, so it's best to handle them accordingly.
Possible values of the error are:
Flutter
React Native
class MeasurementErrors {
static const String brokenAccSensorError = "BROKEN_ACC_SENSOR";
}
FibriCheckView(
...
onMeasurementError: (message) => { ...your code here...},
...
),
export enum MeasurementError {
BrokenAccSensor = 'BROKEN_ACC_SENSOR' // happens on a broken acc sensor on iOS -> can be fixed by rebooting
}
<RNFibriCheckView
...
onMeasurementError={(message: MeasurementError) => ...your code here...}
...
/>

After the recording

these events can be thrown when the recording phase has ended.

onMeasurementProcessed

This event will fire when the measurement has been processed and is converted to a JSON String.
Flutter
React Native
FibriCheckView(
...
onMeasurementProcessed: () => { ...your code here...},
...
),
<RNFibriCheckView
...
onMeasurementProcessed={(data) => ...your code here...}
...
/>