App.tsx.
Prerequisites
- An iPhone on iOS 15 or later, or an Android 9 (API 28) or later phone. Simulators and emulators cannot take a reading.
- React Native 0.86 or newer (New Architecture) and Android
minSdkVersion28. - Xcode 27 or newer, which needs the UIScene life cycle (Requirements). The React
Native 0.88 template has it. On 0.86 or 0.87, use the sample app’s
AppDelegate.swiftwith your module name, and add itsUIApplicationSceneManifestto yourInfo.plist. - Expo: Expo Go cannot load the native module, so use a development build.
- From NEUROFIT: a license key and a download token. The key lists every bundle identifier you run, development ones included (Debug builds).
- The pre-built flow ships in English (localize it).
Install
NEUROFIT_DOWNLOAD_TOKEN in your shell and in CI. Then:
minSdkVersion = 28 in
android/build.gradle. Offline builds, your own repository or a source license:
Install from source or manually.
Camera usage
Add the two keys from the iOS quickstart toios/<YourApp>/Info.plist. Android
needs nothing: the package’s manifest declares CAMERA.
Activate
Read the key from your app’s config, kept out of git.activate rejects with code licenseInvalid and a reason (reasons and fixes).
An Android debug build also accepts a key that does not list your app id, then resolves a warning in warnings and
prints it in Metro, because release builds refuse that key (Debug builds).
Option A: pre-built reading flow
onComplete, onCancel, onError fires when the user leaves the flow
(callbacks and options). It locks portrait on Android. On iOS, restrict your app’s
orientations (Orientation and screen).
Option B: your own screens
Ask for camera access, subscribe to events, then callstart()
(Starting a session).
useReading.ts
VitalsCameraPreview and start once it is ready
(Camera preview rules). ReadingOverlay is your view that calls useReading.
stop() on unmount. Lock portrait and keep the screen on
(Orientation and screen). Every event:
Reading lifecycle.