# react-native-expo-read-sms

> React Native Expo Read SMS is a React Native library for reading SMS from inbox of Android device.

Latest version **1.2.1** (published 2023-11-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-expo-read-sms
pnpm add react-native-expo-read-sms
yarn add react-native-expo-read-sms
bun add react-native-expo-read-sms
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2023-11-10 |
| First published | 2023-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 146.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 84 |
| Author | Abhishek Jain |
| Maintainers | markolofsen |
| Keywords | react-native, sms, read sms, android sms |

## Links

- npm: https://www.npmjs.com/package/react-native-expo-read-sms
- Repository: https://github.com/maniac-tech/react-native-expo-read-sms
- Homepage: https://github.com/maniac-tech/react-native-expo-read-sms#readme
- Issues: https://github.com/maniac-tech/react-native-expo-read-sms/issues
- npm.io page: https://npm.io/package/react-native-expo-read-sms

## 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

- 1.2.1 (latest) — 2023-11-10
- 1.2.0 — 2023-11-10
- 1.1.0 — 2023-11-10

## README

# react-native-expo-read-sms

## Maintainers

[markolofsen](https://github.com/markolofsen/) Active maintainer

## Installation

Install this in your managed Expo project by running this command:

`$ npm install react-native-expo-read-sms --save`

## Usage

1. Import the startReadSMS function after installation

	`import { startReadSMS } from "react-native-expo-read-sms";`

2. Pass Success and Error callbacks
	`startReadSMS(successCallbackFn, errorCallbackFn)`

3. Everytime an SMS has been received `successCallbackFn` will be called with the sms

## Example

You may refer to this sample application for how to use the library: [GitHub Repo](https://github.com/markolofsen/react-native-expo-read-sms)

## Methods
| Method name | Description | Params | Returns |
|-------------|-------------|--------|---------|
| `checkIfHasSMSPermission` | Function which checks if the application has `READ_SMS` and `RECEIVE_SMS` permissions | - | ```{ hasReceiveSmsPermission: true/false, hasReadSmsPermission: true/false }``` |
| `requestReadSMSPermission` | Requests `READ_SMS` and `RECEIVE_SMS` permission, if missing | - | Returns `true` if granted, and `false` otherwise |
| `startReadSMS` | Starts listening for incoming messages. Note: SMS Permissions should be present. | callback fn | Return a string with message orginating address, and message body. Example: `[+919999999999, this is a sample message body]` |


### Important Note:
Ensure your app has `READ_SMS`, and `RECEIVE_SMS`, failing which you'll receive error on calling the function

## Support
Tested on Expo SDK v44 & v45, and Node JS v14

## License
MIT

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