Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

I Use Ionic Capacitor 5 Angular Phone Authentication Implementation in that Recaptha is Not Working for Ios and it works in Andriod

$
0
0

I use
@angular/fire”: “^16.0.0”,
@capacitor/cli”: “5.0.5”,
@capacitor/ios”: “^5.7.1”,
@capacitor/android”: “5.0.5”,

code to send otp

import { AngularFireAuth } from ‘@angular/fire/compat/auth’;
import firebase from ‘firebase/compat/app’;
constructor(private http: HttpClient,public ngFireAuth: AngularFireAuth,private storage: Storage) {}

recaptchaVerifier!: firebase.auth.RecaptchaVerifier;
this.recaptchaVerifier = new firebase.auth.RecaptchaVerifier(‘recaptcha-container’, {
‘size’: ‘invisible’, // or ‘normal’ for a visible captcha
‘callback’: (response: string) => {
// reCAPTCHA solved - proceed with phone authentication
// console.log(“reCAPTCHA solved, response:”, response);
// You can use the response token here if needed
},
‘expired-callback’: () => {
// Handle expired reCAPTCHA
console.log(“reCAPTCHA expired. Please solve it again.”);
}
});
}

async sendOtp(phoneNumber: string, recaptchaVerifier: firebase.auth.RecaptchaVerifier) {
return this.ngFireAuth.signInWithPhoneNumber(phoneNumber, recaptchaVerifier);
}

Recaptha Does work in Ios i get Undefined error in console iOS.
Same code works for Andriod
I Observe in ios my url is capacitor://127.0.0.1 which i cannot directly added in firebase → authroized domain. for Andriod it is http://127.0.01 and identity Took API is working there not in ios

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles