我目前在尝试将 Google Firebase 身份验证集成到 React Ionic 移动应用程序中时遇到一些问题。到目前为止,我已经能够将应用程序设置为在网络和 Android 上正确运行,但在 IOS 上反复遇到问题。该代码在 Android 上正确运行Firebase 身份验证登录,但似乎无法在 IOS 上运行。
对“signInWithEmailAndPassword”的初始调用似乎工作正常并返回“auth/multi-factor-auth-required”,但每当我尝试在 ios 上调用“ verifyPhoneNumber ”时,我都会收到“Firebase:内部验证”的响应发生了 AuthError。(auth/internal-error)”,返回的错误的任何部分都没有提供进一步的详细信息。
//Firebase setup in seperate file with code like these 2 lines
app.initializeApp(config);
const firebaseAuth = app.auth();
//
firebaseAuth
.signInWithEmailAndPassword(email, password)
.then(function (user) {
//other code
})
.catch(function (error) {
if (error.code === "auth/multi-factor-auth-required") {
let resolver = error.resolver;
setTimeout(() => {
phoneAuth(appVerifier, resolver);
}, 2000);
} else {
//other code
}
});
//following code is part …Run Code Online (Sandbox Code Playgroud) ios firebase ionic-framework firebase-authentication ionic-react