# @lowkey/react-native-open-sms

> Open message composer in app

Latest version **0.1.1** (published 2021-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lowkey/react-native-open-sms
pnpm add @lowkey/react-native-open-sms
yarn add @lowkey/react-native-open-sms
bun add @lowkey/react-native-open-sms
```

## 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.1 |
| Published | 2021-04-15 |
| First published | 2021-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 28.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Max Prokopenko |
| Maintainers | max-prokopenko |
| Keywords | react-native, ios |

## Links

- npm: https://www.npmjs.com/package/@lowkey/react-native-open-sms
- Repository: https://github.com/max-prokopenko/react-native-open-sms
- Homepage: https://github.com/max-prokopenko/react-native-open-sms#readme
- Issues: https://github.com/max-prokopenko/react-native-open-sms/issues
- npm.io page: https://npm.io/package/@lowkey/react-native-open-sms

## Recent versions

- 0.1.1 (latest) — 2021-04-15
- 0.1.0 — 2021-04-15

## README

# react-native-open-sms

Open a system standard interface, which lets the user compose and send SMS messages.(iMessage etc)

![EB4B4044-6A97-43D3-8253-80E0A94A5AA8](https://user-images.githubusercontent.com/20337903/114843299-576f1700-9de2-11eb-92bc-b7e759838da1.GIF)

## Installation

```sh
npm install @lowkey/react-native-open-sms
```
or
```sh
yarn add @lowkey/react-native-open-sms
```

Install pods
```sh
npx pod-install
```

## Usage

```js
import OpenSms from '@lowkey/react-native-open-sms';

// ...

const openComposer = () => {
    OpenSms.displaySMSComposerSheet({
      body: 'Hello my dear friend!',
      recipients: ['1234567890'],
    }).then((result: string) => {
      switch (result) {
        case OpenSms.Types.Sent:
          console.log('Message was sent!');
          break;
        case OpenSms.Types.Cancelled:
          console.log('Sending was cancelled!');
          break;
        case OpenSms.Types.Failed:
          console.log('Sending failed');
          break;
        case OpenSms.Types.NotSupported:
          console.log('Sending is not supported');
          break;
        default:
          console.log('Error occupied', result);
          break;
      }
    });
  };

```

## Props
| Prop  | Type  | Description | Required |
| ----------------| ---------------- |:----------------:|:----------------:|
| body      | String      | Message Text     |false     |
| recipients      | string[]      | Message recipients     |true     |

## Types

Action types returned when promise is resolved

| Type  | Description | 
| ----------------| ---------------- |
| OpenSms.Types.Sent      | Message was sent      |
| OpenSms.Types.Cancelled      | User canceled message sending      |
| OpenSms.Types.Failed      | Message sending failed      |
| OpenSms.Types.NotSupported      | Message sending is not supported (iOS simulator)      |

## Contributing

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

## License

MIT

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