Closed ThomasTricot closed 6 days ago
Hi @ThomasTricot, thanks for reporting this issue! A couple questions:
Hello @dlarocque ! Thank you for taking my problem seriously.
When I say that auth and app-check are functional, let me explain (Both explanation works on my device iOS): For auth, I have a function that launches when my application is launched, telling me that auth is working correctly (I got the log "Firebase Auth is initialized") :
async checkFirebaseAuthInitialization() {
const unsubscribe = onAuthStateChanged(this._fireAuth, () => {
console.log("Firebase Auth is initialized");
unsubscribe();
}, (error) => {
console.error('Error initializing Firebase Auth: ', error);
});
}
For app-check, I deduce that it works correctly because when I add my application as a test application in console.firebase.com it works correctly. If my app is added, I can retrieve data from my firestore storage, but I can't if I don't add my application to console.firebase.com
No, I don't see any errors when I launch my application in http://localhost:8100 on my browser (without going through Xcode). The sms from the signInWithPhoneNumber function is received and I manage to connect. When I switch to native iOS, I get the error explained earlier. Here's my code that allows me to send an sms that returns the error explained earlier in the catch throw:
import {Auth, onAuthStateChanged, RecaptchaVerifier, signInWithPhoneNumber} from '@angular/fire/auth';
//[ ... ]
recaptcha() {
this.appVerifier = new RecaptchaVerifier('sign-in-button', {
callback: (response:any) => {
},
'expired-callback': (response:any) => {
}
}, this._fireAuth);
}
async signInWithPhoneNumber(phoneNumber:any) {
try {
if(!this.appVerifier) {
this.recaptcha();
}
const confirmationResult = await signInWithPhoneNumber(this._fireAuth, phoneNumber, this.appVerifier);
this.confirmationResult = confirmationResult;
return confirmationResult;
} catch(e) {
console.error("ERROR : " + e)
throw(e);
}
}
async verifyOtp(otp:any) {
try {
if(!this.appVerifier) {this.recaptcha();}
const result = await this.confirmationResult.confirm(otp);
console.log(result);
const user = result?.user;
console.log(user);
this.UID = user.uid;
} catch(e) {
throw e;
}
}
HI @ThomasTricot,
A few more questions, if you don't mind.
The stack traces are obfuscated and they don't tell us which auth operation is failing. Could you add some debug logs to determine if this is in response to a specific operation that you're invoking?
Also I've noticed that this entry repeats in the stack trace which makes me concerned that there's a recursive loop:
c@capacitor://localhost/polyfills.441dd4ca9dc0674f.js:1:18436
Is there a way for us to better understand what this line is?
Thanks!
Hey @ThomasTricot. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Since there haven't been any recent updates here, I am going to close this issue.
@ThomasTricot if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.
Operating System
iOS 17
Browser Version
Capacitor 5.3.0
Firebase SDK Version
json api
Firebase SDK Product:
Auth
Describe your project's tooling
ionic Capacitor
Describe the problem
Hello,
I have a problem with phone authentication on my iOS device. When I click on my RecaptchaVerifier container, I get this error:
On the web (using
ionic serve
) it works perfectly, I can see my reCaptcha.After investigating, on my device, Auth is fully functional, as is my AppCheck. Here is my app.module.ts :
And here is my capacitor.config.ts :
Please can someone help me I feel like I've already tried everything but nothing works... Thanks!
Steps and code to reproduce issue
I'm sorry, I don't know how to do this.