# react-native-prompt-android

> Polyfill for Alert.prompt on Android

Latest version **1.1.0** (published 2019-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-prompt-android
pnpm add react-native-prompt-android
yarn add react-native-prompt-android
bun add react-native-prompt-android
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2019-09-18 |
| First published | 2016-10-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 48.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 128 |
| Maintainers | bellzhong, magicismight, pychen, wsong910 |
| Keywords | react-component, react-native, prompt, Alert, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-prompt-android
- Repository: https://github.com/shimohq/react-native-prompt-android
- Homepage: https://github.com/shimohq/react-native-prompt-android#readme
- Issues: https://github.com/shimohq/react-native-prompt-android/issues
- npm.io page: https://npm.io/package/react-native-prompt-android

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2019-09-18
- 1.0.0 — 2019-09-17
- 0.3.6 — 2019-09-06
- 0.3.5 — 2019-04-11
- 0.3.4 — 2018-10-19
- 0.3.3 — 2018-02-07
- 0.3.2 — 2018-02-06
- 0.3.1 — 2017-08-24
- 0.3.0 — 2017-08-03
- 0.2.0 — 2017-07-18
- 0.1.0 — 2017-07-10
- 0.0.8 — 2017-06-30
- 0.0.7 — 2017-06-30
- 0.0.6 — 2017-06-29
- 0.0.5 — 2016-12-05
- … 4 more at https://npm.io/package/react-native-prompt-android/versions

## README

# react-native-prompt-android
A polyfill library for Alert.prompt on Android platform, working both on Android and iOS platform(iOS using [AlertIOS.prompt](http://facebook.github.io/react-native/docs/alertios.html#prompt))


### Installation

* Install from npm

```bash
npm i react-native-prompt-android --save
```

* Link native library

You can use react-native-cli:
```bash
react-native link react-native-prompt-android
```

Or rnpm:
```bash
rnpm link react-native-prompt-android
```

### Usage

```
import prompt from 'react-native-prompt-android';
prompt(
    'Enter password',
    'Enter your password to claim your $1.5B in lottery winnings',
    [
     {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
     {text: 'OK', onPress: password => console.log('OK Pressed, password: ' + password)},
    ],
    {
        type: 'secure-text',
        cancelable: false,
        defaultValue: 'test',
        placeholder: 'placeholder'
    }
);
```

## Props

 name                 | description                                 | type     | default
:-------------------- |:------------------------------------------- | --------:|:------------------
 type                 | Text input type: `'numeric', 'secure-text', 'phone-pad', 'email-address'`  |   String | 'default'
 cancelable           |                                             |  Boolean |
 defaultValue         | Default input value                         |   String | ''
 keyboardType         | The keyboard type of first text field(if exists). One of `'default'`, `'email-address'`, `'numeric'`, `'phone-pad'`, `'ascii-capable'`, `'numbers-and-punctuation'`, `'url'`, `'number-pad'`, `'name-phone-pad'`, `'decimal-pad'`, `'twitter'` or `'web-search'`. | String | 'default'
 placeholder          |                                             |   String | ''



![Android Screen Shoot](./Example/android.png)

![Android Screen Shoot](./Example/ios.png)

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