Skip to content

ReactNative SDK 4.3.4

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.

bash
npm install "https://sdk.panoptic.ai/npm/react-native-vital-sign-plugin-4.3.4.tgz"
bash
yarn add "https://sdk.panoptic.ai/npm/react-native-vital-sign-plugin-4.3.4.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.

Update pod's config

Some dependencies do not support the ARM simulator on Apple Silicon machines. Additionally, React Native's script may incorrectly set the deployment target for certain pods. Please update your Podfile as follows to address these issues:

ruby
post_install do |installer|

  # ...

  # Add the following to your Podfile
  installer.pods_project.targets.each do |target|
    # Use x86 simulator
    target.build_configurations.each do |config|
      config.build_settings['ARCHS[sdk=iphonesimulator*]'] = 'x86_64'
    end
  end
end

Camera Permission

When developing for iOS, you need to allow the app to use the camera by specifying the following in the file Info.plist:

xml
<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:

groovy
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')

    // ...
}

In android/gradle.properties, add:

groovy
kotlinVersion=1.8.0

Camera Permission

When developing for Android, you need to allow the app to use the camera by specifying the following in the file AndroidManifest.xml:

xml
<uses-permission android:name="android.permission.CAMERA" />

What's new

4.3.4 (19-June-2025)

  • Removed ZIPFoundation dependency.

4.3.3 (13-June-2025)

  • The use_frameworks! directive is now optional in the Podfile, allowing the SDK to work with or without it.
  • If use_frameworks! is being used, both dynamic and static linking are supported.

4.3.2 (20-May-2025)

  • Fixed the crash in iOS 16 or below.

4.3.1 (16-May-2025)

  • Removed unnecessary build dependency for iOS.

4.3.0 (8-May-2025)

  • Introduced support for Server version 3.9.0 (Schema 1.5), featuring the new Cholesterol Risk functionality (Beta). To calculate cholesterol risk, the UserInfo object now requires the additional property alcoholic. For example:

    typescript
    const userInfo: UserInfo = {
      // ...
      alcoholic: false,
    };