# react-native-fall-detection-module

> Fall Detection Library

Latest version **0.1.4** (published 2022-04-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-fall-detection-module
pnpm add react-native-fall-detection-module
yarn add react-native-fall-detection-module
bun add react-native-fall-detection-module
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2022-04-17 |
| First published | 2022-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 308.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Alissa |
| Maintainers | alissayarmantho |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-fall-detection-module
- Repository: https://github.com/alissayarmantho/react-native-fall-detection-module
- Homepage: https://github.com/alissayarmantho/react-native-fall-detection-module#readme
- Issues: https://github.com/alissayarmantho/react-native-fall-detection-module/issues
- npm.io page: https://npm.io/package/react-native-fall-detection-module

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.4 (latest) — 2022-04-17
- 0.1.3 — 2022-01-18
- 0.1.2 — 2022-01-18
- 0.1.1 — 2022-01-17
- 0.1.0 — 2022-01-16

## README

# react-native-fall-detection-module

Fall Detection Library

When using a typical react native sensors library to try to detect a fall, we will need to set the update interval to < 100ms. However, this will cause the react native bridge to be overloaded. As such, the processing of the sensors data cannot be done in the React Native code.
As a solution, this library will only send events through the react native bridge when a fall is detected.

## Compatibility

Compatible with android only. If anyone would like to contribute to the IOS version of the code, please feel free to contribute to this project!

## Installation

```sh
npm install react-native-fall-detection-module
```

## Usage

```js
import {
  FallDetectionEmitter,
  start,
} from 'react-native-fall-detection-module';
// ...

  const [data, setData] = React.useState<any | undefined>();

  React.useEffect(() => {
    start();
  }, []);

  React.useEffect(() => {
    FallDetectionEmitter.addListener('fall', (newData: any) => {
      console.log(newData);
      setData(newData);
      // put your data processing step here
    });
  }, []);
```

Data format being sent when a fall is detected is 
```
{"detected" : true}
```
otherwise no data is being sent

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

# Acknowledgement
This library is adapted from [here](https://github.com/altermarkive/experimental-fall-detector-android-app)

---
_Source: https://npm.io/package/react-native-fall-detection-module · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
