Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
332 views
in Technique[技术] by (71.8m points)

android - Activating google password manager prompt @ React-Native app

I'm developing a new app for android with React-Native 0.63.4 and I want google services to prompt storing users credentials with google password manager. I'm using Formik to manage my form actions.

Here is the code:

            <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>

Both <Input /> and <PasswordInput /> inherit from React-Native's <TextInput /> element and forward the {...props} as a last line before ">".

Props as textContentType and autoCompleteType are set, but I still don't have a prompt to store the credentials, what am I missing?

p.s. Other native apps are definitely prompted after a successful login, same way it's implemented in most web browsers. The question is how it's implemented in react-native if at all?

question from:https://stackoverflow.com/questions/65885463/activating-google-password-manager-prompt-react-native-app

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...