在React Native中将Touch ID与Firebase Auth集成

在React Native中将Touch ID与Firebase Auth集成,firebase,react-native,firebase-authentication,touch-id,Firebase,React Native,Firebase Authentication,Touch Id,我不熟悉React native,但我已经创建了一个使用React native firebase软件包(基于)的注册/登录,我想加入touch id以允许用户登录,但我在网上找不到任何示例(在React native with firebase中)。我看过react native指纹扫描仪和react native touch id的软件包,它们是直接实现的,我只是不知道如何将firebase auth和touch id绑定在一起。在此方面的任何帮助都将不胜感激 谢谢这只是一个想法,尚未作为“

我不熟悉React native,但我已经创建了一个使用React native firebase软件包(基于)的注册/登录,我想加入touch id以允许用户登录,但我在网上找不到任何示例(在React native with firebase中)。我看过react native指纹扫描仪和react native touch id的软件包,它们是直接实现的,我只是不知道如何将firebase auth和touch id绑定在一起。在此方面的任何帮助都将不胜感激


谢谢

这只是一个想法,尚未作为“实际代码”实现,但。。。这是我的两分钱,我将如何处理它:

用户注册后,您可以将其电子邮件和密码存储在中,或其他任何内容。然后在用户的设置页面中添加带有指纹的登录功能。从那里,一旦用户决定再次登录,您可以:

1-使用
react native fingerprint scanner
为您提供的承诺

2-从您选择的数据库中获取电子邮件和密码

3-使用该数据与firebase进行身份验证并登录

它看起来是这样的:

handleLogin() {
    FingerprintScanner
        .authenticate({ description: 'Scan your fingerprint to login' })
        .then(() => {
            const sql = "select email, password from user";
            db.runQuery(sql, function(data) { // this is a made-up function
                const { email, pasword } = data
                firebase
                  .auth()
                  .signInWithEmailAndPassword(email, password)
                  .then(() => /*navigate to main page once authenticated*/)
                  .catch(error => this.setState({ errorMessage: error.message 
            });
    })
    .catch(console.error);
}

有改进的余地,但这应该对你有用。希望能有帮助

感谢您的帮助,这里还有一个链接(我还没有完全查看它,但它使用密钥库/密钥链解决密码存储问题)。您如何知道特定指纹与哪个id关联?