Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何让React本机应用程序询问我是否要保存用户名和密码?(iOS 11+)_Ios_React Native_React Navigation_Keychain - Fatal编程技术网

如何让React本机应用程序询问我是否要保存用户名和密码?(iOS 11+)

如何让React本机应用程序询问我是否要保存用户名和密码?(iOS 11+),ios,react-native,react-navigation,keychain,Ios,React Native,React Navigation,Keychain,基于,我尝试在我的应用程序中实现自动填充功能。虽然用户名和密码部分可以自动填充,即在键盘上方,有一个密码按钮,一旦我按下按钮,脸ID就会被激活,我可以选择一个选项,但当我键入用户名和密码并按下登录按钮时,它不会问 非常感谢您的任何建议 import { useForm } from 'react-hook-form'; // Just in case // "@react-navigation/bottom-tabs": "^5.4.2", // "@react-navigation/nativ

基于,我尝试在我的应用程序中实现自动填充功能。虽然用户名和密码部分可以自动填充,即在键盘上方,有一个密码按钮,一旦我按下按钮,脸ID就会被激活,我可以选择一个选项,但当我键入用户名和密码并按下登录按钮时,它不会问

非常感谢您的任何建议

import { useForm } from 'react-hook-form';
// Just in case
// "@react-navigation/bottom-tabs": "^5.4.2",
// "@react-navigation/native": "^5.2.6",
// "@react-navigation/stack": "^5.3.1",
...

export default function screen({navigation, route}) {

 useEffect(()=> {

    register("email");
    register("password")


    return () => {
      console.log("Unmounted");
    }
  }, [register]);

...

return (

 ...
       <View
        style={[
          styles.container,
          styles.emailSection,
          styles.paddingHorizontal,
        ]}>
        <View style={styles.textInputContainer}>
          <TextInput
            onChangeText={text => {
              setValue('email', text);
            }}
            placeholder={'Email'}
            placeholderTextColor="grey"
            keyboardType="email-address"
            autoCapitalize={'none'}
            autoCorrect={false}
            textContentType={'username'}
            style={styles.textInputFont}
          />
        </View>
        <View style={styles.textInputContainer}>
          <TextInput
            onChangeText={text => {
              setValue('password', text);
            }}
            placeholder={'Password'}
            placeholderTextColor="grey"
            keyboardType="default"
            autoCapitalize={'none'}
            autoCorrect={false}
            secureTextEntry={true}
            textContentType={'password'}
            style={styles.textInputFont}
          />
        </View>

        <View>
          <TouchableOpacity
            onPress={
              isEmailLoading ? null : handleSubmit(_onPressEmailSignIn)
            }>
            <View style={[styles.wideButtonContainer]}>
              <Text style={styles.secondaryFont}>Sign In</Text>
            </View>
          </TouchableOpacity>
        </View>

        <View style={styles.textContainer}>
          <TouchableOpacity
            onPress={() => navigation.navigate('ForgotPassword')}>
            <View>
              <Text style={styles.secondaryFont}>Forgot Password</Text>
            </View>
          </TouchableOpacity>
          <TouchableOpacity
            onPress={() => navigation.navigate('EmailSignUp')}>
            <View>
              <Text style={styles.secondaryFont}>Sign Up</Text>
            </View>
          </TouchableOpacity>
        </View>
      </View>
...

)

-在模拟器iPhone Xs 12.0和我的设备iPhone Xr 13.0上试用