ReactNative SDK 4.1.0
Sample Code
The quickest and simplest way to kickstart your journey with the ReactNative SDK is by downloading and experimenting with our full-featured sample code:
IMPORTANT
In the above sample codes, the strings __YOUR_USER_ID__ and __YOUR_API_KEY__ should be replaced by your own User ID and API Key repectively. Please contact us to obtain your User ID and API Key.
Installation
In your ReactNative project, install the SDK with the npm install or yarn add commands.
npm install "https://sdk.panoptic.ai/npm/react-native-vital-sign-plugin-4.1.0.tgz"yarn add "https://sdk.panoptic.ai/npm/react-native-vital-sign-plugin-4.1.0.tgz"Project Integration (for iOS)
IMPORTANT
This version of the SDK requires targeting iOS 15.5 or above. If targeting iOS 12, please use SDK version 3.8.x.
Use x86 for iOS simulator
Some dependencies do not support the ARM simulator on Apple Silicon machines. Please update the Podfile to force the use of the x86 simulator.
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# Force CocoaPods targets to always build for x86_64
config.build_settings['ARCHS[sdk=iphonesimulator*]'] = 'x86_64'
end
end
endUse static framework linking
Add the following to Podfile use static framework linking:
use_frameworks! :linkage => :staticCamera Permission
When developing for iOS, you need to allow the app to use the camera by specifying the following in the file Info.plist:
<key>NSCameraUsageDescription</key>
<string>Use for measuring vital signs</string>TIP
In Info.plist, the string "Use for measuring vital signs" is an example description of the camera usage. You should specify your own description that matches the usage of your application.
Project Integration (for Android)
IMPORTANT
Please note that for Android, the minimum SDK version must be at least 24.
Update the android/app/build.gradle file:
android {
// ...
// Add the packaging options
packagingOptions {
pickFirst '**/*.so'
}
}
dependencies {
// Add the following dependencies.
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
implementation files('../../node_modules/react-native-vital-sign-plugin/android/libs/vital-sign-engine-debug.aar')
// ...
}
// Add this line
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)In android/gradle.properties, add:
kotlinVersion=1.8.0Camera Permission
When developing for Android, you need to allow the app to use the camera by specifying the following in the file AndroidManifest.xml:
<uses-permission android:name="android.permission.CAMERA" />What's new
4.1.0 (10-Mar-2025)
- Added new Vital Signs supported by V2 backend.
- Blink detection is disabled by default. Added API to enable blink detection.