title: React-Native alternative to AlertIOS.prompt for android?
body: <p>I am following a tutorial for react-native, however they are doing it for IOS, there is one part where they use AlertIOS.prompt like this</p>
  <pre><code>AlertIOS.prompt(
    'Add New Item',
    null,
    [
      {text: 'Cancel', onPress: () =&gt; console.log('Cancel Pressed'), style: 'cancel'},
      {
        text: 'Add',
        onPress: (text) =&gt; {
          this.itemsRef.push({ title: text })
        }
      },
    ],
    'plain-text'
  );
  </code></pre>
  <p>I am trying to remake this for android but cannot get it working, I did find this <a href="https://www.npmjs.com/package/react-native-prompt" rel="nofollow noreferrer">https://www.npmjs.com/package/react-native-prompt</a></p>
  <pre><code>import Prompt from 'react-native-prompt';
  &lt;Prompt
  title=&quot;Say something&quot;
  placeholder=&quot;Start typing&quot;
  defaultValue=&quot;Hello&quot;
  visible={ this.state.promptVisible }
  onCancel={ () =&gt; this.setState({
    promptVisible: false,
    message: &quot;You cancelled&quot;
  }) }
  onSubmit={ (value) =&gt; this.setState({
    promptVisible: false,
    message: `You said &quot;${value}&quot;`
  }) }/&gt;
  </code></pre>
  <p>However I cannot get this to work either, It is supposed to display the prompt when I press a button but nothing happens..</p>
  <p>Here is the full original code with AlertIOS</p>
  <pre><code>'use strict';
  
  import React, {Component} from 'react';
  import ReactNative from 'react-native';
  const firebase = require('firebase');
  const StatusBar = require('./components/StatusBar');
  const ActionButton = require('./components/ActionButton');
  const ListItem = require('./components/ListItem');
  const styles = require('./styles.js')
  
  const {
    AppRegistry,
    ListView,
    StyleSheet,
    Text,
    View,
    TouchableHighlight,
    AlertIOS,
  } = ReactNative;
  
  // Initialize Firebase
  const firebaseConfig = {
    apiKey: &quot;AIzaSyA9y6Kv10CAl-QOnSkMehOyCUejwvKZ91E&quot;,
    authDomain: &quot;dontforget.firebaseapp.com&quot;,
    databaseURL: &quot;https://dontforget-bd066.firebaseio.com&quot;,
    storageBucket: &quot;dontforget-bd066.appspot.com&quot;,
  };
  const firebaseApp = firebase.initializeApp(firebaseConfig);
  
  class dontforget extends Component {
  
    constructor(props) {
      super(props);
      this.state = {
        dataSource: new ListView.DataSource({
          rowHasChanged: (row1, row2) =&gt; row1 !== row2,
        })
      };
      this.itemsRef = this.getRef().child('items');
    }
  
    getRef() {
      return firebaseApp.database().ref();
    }
  
    listenForItems(itemsRef) {
      itemsRef.on('value', (snap) =&gt; {
  
        // get children as an array
        var items = [];
        snap.forEach((child) =&gt; {
          items.push({
            title: child.val().title,
            _key: child.key
          });
        });
  
        this.setState({
          dataSource: this.state.dataSource.cloneWithRows(items)
        });
  
      });
    }
  
    componentDidMount() {
      this.listenForItems(this.itemsRef);
    }
  
    render() {
      return (
        &lt;View style={styles.container}&gt;
  
          &lt;StatusBar title=&quot;Grocery List&quot; /&gt;
  
          &lt;ListView
            dataSource={this.state.dataSource}
            renderRow={this._renderItem.bind(this)}
            enableEmptySections={true}
            style={styles.listview}/&gt;
  
          &lt;ActionButton onPress={this._addItem.bind(this)} title=&quot;Add&quot; /&gt;
        &lt;/View&gt;
      )
  
    }
  
    _addItem() {
      AlertIOS.prompt(
        'Add New Item',
        null,
        [
          {text: 'Cancel', onPress: () =&gt; console.log('Cancel Pressed'), style: 'cancel'},
          {
            text: 'Add',
            onPress: (text) =&gt; {
              this.itemsRef.push({ title: text })
            }
          },
        ],
        'plain-text'
      );
    }
    
    
    
    
    _renderItem(item) {
  
      const onPress = () =&gt; {
        AlertIOS.alert(
          'Complete',
          null,
          [
            {text: 'Complete', onPress: (text) =&gt; this.itemsRef.child(item._key).remove()},
            {text: 'Cancel', onPress: (text) =&gt; console.log('Cancelled')}
          ]
        );
      };
  
      return (
        &lt;ListItem item={item} onPress={onPress} /&gt;
      );
    }
  
  }
  
  AppRegistry.registerComponent('dontforget', () =&gt; dontforget);
  </code></pre>
  <p>Could anyone tell me how I could make this work for android?</p>