[BREAKGLASS] A polyfill library for Alert.prompt on Android platform, working both on Android and iOS platform.
Go to file
2017-08-23 11:22:57 +08:00
android fix: ValidFragment 2017-08-23 11:22:57 +08:00
Example Add email example 2017-07-15 12:20:33 -05:00
.editorconfig Init project 2016-10-12 12:46:10 +08:00
.eslintignore Init project 2016-10-12 12:46:10 +08:00
.eslintrc Init project 2016-10-12 12:46:10 +08:00
.gitattributes Init project 2016-10-12 12:46:10 +08:00
.gitignore fix some errors 2017-06-30 13:53:46 +08:00
.npmignore Init project 2016-10-12 12:46:10 +08:00
index.android.js Bump version 2017-07-18 12:27:23 +08:00
index.ios.js add shimo style for android 2017-06-30 13:47:36 +08:00
LICENSE Init project 2016-10-12 12:46:10 +08:00
package.json Bump version 2017-08-03 15:25:24 +08:00
README.md Update README, add props docs 2017-07-15 12:49:21 -05:00

react-native-prompt-android

A polyfill library for Alert.prompt on Android platform, working both on Android and iOS platform(iOS using AlertIOS.prompt)

Installation

  • Install from npm
npm i react-native-prompt-android --save
  • Link native library

You can use react-native-cli:

react-native link react-native-prompt-android

Or rnpm:

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 ''
placeholder String ''

Android Screen Shoot

Android Screen Shoot