0.1.30 • Published 3 years ago

react-native-sensie-module v0.1.30

Weekly downloads
-
License
Proprietary Licen...
Repository
github
Last release
3 years ago

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

0.1.30

3 years ago

0.1.13

3 years ago

0.1.14

3 years ago

0.1.15

3 years ago

0.1.27

3 years ago

0.1.28

3 years ago

0.1.29

3 years ago

0.1.20

3 years ago

0.1.21

3 years ago

0.1.22

3 years ago

0.1.23

3 years ago

0.1.24

3 years ago

0.1.25

3 years ago

0.1.26

3 years ago

0.1.17

3 years ago

0.1.19

3 years ago

0.1.12

3 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago