@exodus/react-native-prompt-android

中文文档
0.3.4-exodus.10发布于 2026/11/05MITTypeScript零依赖近 30 天下载 1.1万

Polyfill for Alert.prompt on Android

原始使用文档
文档目录3 节
  1. Installation
  2. Usage
  3. Props

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

namedescriptiontypedefault
typeText input type: 'numeric', 'secure-text', 'phone-pad', 'email-address'String'default'
cancelableBoolean
defaultValueDefault input valueString''
keyboardTypeThe 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'
placeholderString''

Android Screen Shoot

Android Screen Shoot

版本与发布记录

@exodus/react-native-prompt-android 共发布 10 个版本,首次发布于 2023/01/26;过去 12 个月发布了 8 个版本。

版本发布日期距今
0.3.4-exodus.10latest2026/11/058 天前
0.3.4-exodus.9activity.12026/08/063 个月前
0.3.4-exodus.82026/04/276 个月前
0.3.4-exodus.72026/04/166 个月前
0.3.4-exodus.62026/03/237 个月前
0.3.4-exodus.52026/03/177 个月前

关于 @exodus/react-native-prompt-android 的常见问题

@exodus/react-native-prompt-android 是什么?

Polyfill for Alert.prompt on Android

如何安装 @exodus/react-native-prompt-android?

在项目目录运行 npm install @exodus/react-native-prompt-android,或使用 pnpm add / yarn add / bun add。

@exodus/react-native-prompt-android 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@exodus/react-native-prompt-android 可以商用吗?

@exodus/react-native-prompt-android 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@exodus/react-native-prompt-android 的下载量有多少?

根据 npm 官方下载统计,@exodus/react-native-prompt-android 在 2026/10/14 – 2026/11/12 这 30 天内被下载 10,831 次,日均约 361 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@exodus/react-native-prompt-android 还在维护吗?

最新版本 0.3.4-exodus.10 发布于 2026/11/05(8 天前);至今共发布 10 个版本,其中过去 12 个月发布了 8 个;首次发布于 2023/01/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。