ReactNative SDK 3.0.6
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.
SDK 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-3.0.6.tgz"yarn add "https://sdk.panoptic.ai/npm/react-native-vital-sign-plugin-3.0.6.tgz"TIP
If you are using Yarn v2 or later, you might need to include the package name in the command, such as yarn add vital-sign-camera@"https://sdk.panoptic.ai/npm/react-native-vital-sign-plugin-3.0.6.tgz".
Camera Permission
When developing for iOS or Android, you need to allow the app to use the camera by specifying the following in Info.plist for iOS, and AndroidManifest.xml for Android:
<key>NSCameraUsageDescription</key>
<string>Use for measuring vital signs</string><uses-permission android:name="android.permission.CAMERA" />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.
What's new
3.0.6 (24-Jan-2024)
- Fixed Android blank camera problem.
- The property
deviceis now optional.
IMPORTANT
To avoid the Android blank camera problem, please update the code to pass in the correct device to the component. It is because some Android devices do not have the wide-screen-camera. An althernative to fix the problem is to omit the device property and let the SDK to select the correct camera. For detail, please refer to the sample code.
Also, the device is not optional, please remove the following code from your page that using the component:
// This code is not needed any more. Please remove it.
if (device == null) {
return <></>
}3.0.5 (4-Oct-2023)
- Fixed iPhone 15 crash.
Migration from 2.x SDK
- If you are using our ReactNative 2.x SDK and want to migrate to the latest API of the ReactNative 3.x SDK, please follow our Migration Guide.
For ReactNative 2.x SDK only:
The 3.x SDK is designed to be 100% backward compatiable to 2.x SDK, all the 2.x API is still available in 3.x SDK. Your code works well with 3.x SDK without any code change. However, 2.x API will be deprecated and all the new advanced features will be added to 3.x API only. Please follow our Migration Guide for migrating to 3.x SDK.