Prerequisites
- An iPhone on iOS 15 or later, or an Android 9 (API 28) or later phone. Simulators and emulators cannot take a reading.
- Capacitor 8, JDK 21, and Xcode 27 or newer, which needs the UIScene life cycle (Requirements).
- From NEUROFIT: a license key and a download token. The key lists every bundle identifier you run, development ones included (Debug builds).
Install
NEUROFIT_DOWNLOAD_TOKEN in your shell and in CI. Then:
minSdkVersion = 28 in
android/variables.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/App/App/Info.plist. Android
needs nothing: the plugin’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 the console, because release builds refuse that key (Debug builds).
Option B: your own screens
Capacitor has no pre-built flow, and a camera preview is on the Roadmap. Ask for camera access, subscribe to events, then callstart() (Starting a session).
reading.ts
runReading then rejects, cleans up and calls stop(). Lock portrait and keep
the screen on (Orientation and screen). Every event:
Reading lifecycle.