Jor*_*vis 6 ios firebase ionic-framework firebase-authentication ionic-react
我目前在尝试将 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 of the method phoneAuth() above
var phoneInfoOptions = {
var phoneInfoOptions = {
multiFactorHint: resolver.hints[0],
session: resolver.session,
};
var phoneAuthProvider = new firebase.PhoneAuthProvider();
phoneAuthProvider
.verifyPhoneNumber(phoneInfoOptions, appVerifier)
.then(function (verificationId) {
console.log("verify Id recieved");
})
.catch((error) => {
console.log(error);
});
Run Code Online (Sandbox Code Playgroud)
到目前为止我已经检查/尝试过的事情是:按照firebase 文档中的所有步骤 在 firebase 控制台中设置 ios 应用程序并按照列出的步骤进行操作
有没有人以前遇到过类似的问题,并对我接下来可以检查的内容有任何建议?
谢谢
| 归档时间: |
|
| 查看次数: |
1344 次 |
| 最近记录: |