Skip to content
On this page

PPG Device Session

Besides measurements using the camera, the SDK also supports Vital Sign measurements using PPG Devices. The current supported devices are:

  • Polar (Polar Verity Sense model)

Creating a PPG Device session is done by using the PolarSessionBuilder API

Dart
try {
    LicenseDetails licenseDetails = LicenseDetails("<ENTER_YOUR_LICENSE_KEY>");
    String deviceId = "<ENTER_POLAR_DEVICE_ID>"
    Session? session = await PolarSessionBuilder(deviceId)
        .withVitalSignsListener(this)
        .withSessionInfoListener(this)
        .withPPGDeviceInfoListener(this)
        .build(licenseDetails);
} on HealthMonitorException catch(e) {
    print("Received Error. Domain: ${e.domain} Code: ${e.code}");
}

During the session's initialization, the SDK attempts to connect with the given PPG Device, based on the type of the device and the given device ID. The session only changes its state to the ready state if the connection was established. Session creation may fail due to various reasons. For instance, the mobile device's Bluetooth might be disabled, or the PPG device firmware version is too low. For more information on each error, please refer to the Alerts List.