如何解决激活谷歌密码管理器提示@ React-Native 应用程序
我正在使用 React-Native 0.63.4 为 android 开发一个新应用程序,我希望谷歌服务提示使用谷歌密码管理器存储用户凭据。我正在使用 Formik 来管理我的表单操作。
代码如下:
<View style={styles.formContainer}>
<Input
onChangeText={handleChange('email')}
onBlur={(e) => {
handleBlur('email')(e);
}}
placeholder={emailPlaceholder}
autoCompleteType="email"
autoCapitalize="none"
keyboardType="email-address"
textContentType="emailAddress"
value={values.email}
isError={Boolean(errors.email && touched.email)}
errorMessage={errors.email}
/>
<PasswordInput
placeholder={passwordPlaceholder}
notFocusedText={continueToResetPassword}
textContentType="password"
onChangeText={handleChange('password')}
onBlur={(e) => {
handleBlur('password')(e);
}}
value={values.password}
isError={Boolean(errors.password && touched.password)}
errorMessage={errors.password}
notFocusedTextOnPress={() =>
navigation.navigate('EnterEmail',{
email: values.email,})
}
/>
<Button text={isSubmitting ? '' : button} onPress={handleSubmit}>
{isSubmitting ? <ActivityIndicator color="black" /> : null}
</Button>
</View>
<Input />
和 <PasswordInput />
都继承自 React-Native 的 <TextInput />
元素,并将 {...props} 作为 ">" 之前的最后一行转发。
设置了 textContentType 和 autoCompleteType 属性,但我仍然没有提示存储凭据,我缺少什么?
附言成功登录后肯定会提示其他本机应用程序,与大多数 Web 浏览器中实现的方式相同。问题是它是如何在 react-native 中实现的?
解决方法
根据您的代码,您尚未将 autoCompleteType
添加到 <PasswordInput/>
。
尝试将 autoCompleteType="password"
添加到您的 <PasswordInput/>
中。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。