2.0.2 • Published 6 days ago

@spren/react-native v2.0.2

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
6 days ago

Spren Bridge

Requirements

iOSAndroid
SupportiOS 14+API 28+

Features

  • Records biological activity data.

Installation

npm install @spren/react-native --save

iOS

Add one row to the ios/Runner/Info.plist:

  • one with the key Privacy - Camera Usage Description and a usage description.

If editing Info.plist as text, add:

<key>NSCameraUsageDescription</key>
<string>To measure your heart rate in order to provide you valuable insights.</string>

API

import {SprenView} from '@spren/react-native';
const sprenRef = useRef<SprenView>();
return (
  <SprenView
    ref={sprenRef}
    onStateChange={(event: IStateChange) => {})
    onProgressUpdate={(event: IProgressChange) => {})
    onReadingDataReady={async (event: IReadingDataReady) => {})
  >{children}</SprenView>
)
MethodParametersDescription
sprenRef.current?.getReadingData()stringReturns reading data information (needs to be called when reading is over)
sprenRef.current?.cancelReading()Cancels the ongoing reading
sprenRef.current?.captureStart()Starts camera capture
sprenRef.current?.captureStop()Stops camera capture
sprenRef.current?.setAutoStart(bool) iOS onlytrue,falseSet reading auto start. autoStart by default is false. Set autoStart to true if you want reading to start automatically.
sprenRef.current?.dropComplexity() iOS onlyLower camera resolution and/or frame rate when phone load gets too high
sprenRef.current?.setTorchMode(string) iOS only"0","1","2"Configure flash light mode. torchMode possible values are: "0" - The capture device torch is always off. "1" - The capture device torch is always on. "2" - The capture device continuously monitors light levels and uses the torch when necessary.
sprenRef.current?.captureLock() iOS onlyLocks camera device configuration
sprenRef.current?.captureUnlock() iOS onlyUnlocks camera device configuration
sprenRef.current?.turnFlashOn() Android onlySets Flash On
sprenRef.current?.reset() Android onlyReset new reading to the beginning state

Usage

For more elaborate usage example see here.

For a quick entry point, checkout these files:

2.0.2

6 days ago

2.0.1

1 year ago

1.2.0

2 years ago

1.2.2

2 years ago

2.0.0

2 years ago

1.2.1

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago