react-native-sensie-module
TypeScript icon, indicating that this package has built-in type declarations

0.1.30 • Public • Published

react-native-sensie-module

  React Native Sensie SDK.
  Docs

Installation

   Install via yarn. Link it and install dependencies for ios.

yarn add react-native-sensie-module
npx react-native link
cd ios && pod install

Usage

Import

   Import SensieEngine and CalibrationSession class.

import { SensieEngine } from "react-native-sensie-module";

Initination

   Pass the generated token for Sensie SDK.

const s = new SensieEngine({accessToken: '[Token]'})

Connection

   A method to establish a connection. It should return a promise that will tell us if the connection was successful.

await s.connect()

   Also, canRecalibrate property will be set depending on stored sensies in storage.

Calibration

calibrationSession = await s.startCalibration({
    userId,
    onEnds: (result) => {
    }
})

   result will be an object with a single property contains calibration strength.

Capturing Sensie

const sensie = await calibrationSession.captureSensie({
    flow,
    onSensorData: (data) => {
    }
})

   sensie will be an object with the following properties:

  • id: the id of the sensie
  • whips: the number of whips
  • valid: true if whips == 3

   flow is boolean value(true or false)

   onSensorData is a callback function that will be called every time we have new values from the sensors (optional)

   data will be an object with the following properties:

  • gyroX: the gyroscope X axis value
  • gyroY: the gyroscope Y axis value
  • gyroZ: the gyroscope Z axis value
  • accelX: the accelerometer X axis value
  • accelY: the accelerometer Y axis value
  • accelZ: the accelerometer Z axis value

Resetting

   Reset storage if you want to recalibrate.

await s.resetCalibration();

Evaluation

await s.startEvaluation(userId) // creation of evaluation session

const sensie = await s.captureSensie({
  userId,
  onSensorData: (data) => {}, // (optional)
});

   sensie object will be an object with the following properties:

  • id: the id of the sensie but undefied yet.
  • whips: the number of whips
  • flowing: the result of the evaluation (true or false)
  • setAgreement: Method for setting agreement. Sensie id will be set as soon as the agrement value is set. Agreement enum is included in the index.tsx.

Setting agreement

enum Agreement {
  Agree = 1,
  Disagree = -1,
  AgreeAfterReflecting = 2,
}

sensie.setAgreement(Agreement.Agree)

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

Proprietary Software

Package Sidebar

Install

npm i react-native-sensie-module

Weekly Downloads

1

Version

0.1.30

License

Proprietary License

Unpacked Size

138 MB

Total Files

1415

Last publish

Collaborators

  • junholee