3

I'm new to android ecosystem (sure) and trying to show Samsung Pass Prompt on login page. I have:

        <TextInput
          textContentType="password"
          autoCapitalize="none"
          secureTextEntry={true}
          value={this.state.password}
          underlineColorAndroid="transparent"
        />

And it doesn't work. I mean TextInput does work, but prompt doesn't appear on the screen. Probably I'm missing something, or, in worse case, it is not implemented in React-Native yet(or something like that).

Any suggestions, libraries that can help me with showing Samsung Pass Prompt?

Using:

  • Not Expo App
  • React 16.6.1
  • React-Native 0.57.5
Alex Shtromberg
  • 740
  • 8
  • 21

2 Answers2

0

This is is React-Native-Modal with TextInput in it here is an example.

    import React, {Component} from 'react';
    import {Modal, Text, TouchableHighlight, View, Alert} from 
    'react-native';

    class ModalExample extends Component {
     state = {
    modalVisible: false,
        };

     setModalVisible(visible) {
     this.setState({modalVisible: visible});
      }

      render() {
        return (
         <View style={{marginTop: 22}}>
           <Modal
            animationType="slide"
            transparent={false}
            visible={this.state.modalVisible}
            onRequestClose={() => {
            Alert.alert('Modal has been closed.');
          }}>
          <View style={{marginTop: 22}}>
            <View>
              <TextInput
                 textContentType="password"
                 autoCapitalize="none"
                 secureTextEntry={true}
                 value={this.state.password}
                 underlineColorAndroid="transparent"
              />
            </View>
          </View>
        </Modal>

        <TouchableHighlight
          onPress={() => {
            this.setModalVisible(true);
          }}>
          <Text>Show Modal</Text>
        </TouchableHighlight>
      </View>
    ); }}
Waheed Akhtar
  • 3,110
  • 1
  • 16
  • 30
0

Here's an example TextInput that I am using which does show the Samsung Pass prompt:

        <TextInput
          autoCapitalize="none"
          autoCompleteType="username"
          autoCorrect={false}
          clearButtonMode="while-editing"
          keyboardType="email-address"
          label="Username"
          mode="outlined"
          onChangeText={handleChangeUsername}
          onSubmitEditing={handleSubmitLogin}
          spellCheck={false}
          style={styles.input}
          testID="username"
          textContentType="username"
          value={username}
         />

The textContentType prop will enable the prompt to show up as long as you're testing the app on a physical device and not an emulator.

skay
  • 11
  • 1