here’s my code
home.html
<form (ngSubmit) = "submitforOTP()"> </form>
home.ts
submitforOTP(){
.
.
this.send()
console.log("code received");
this.codesent = true;
}
send(code_country,tel){
var numIn = code_country+tel;
let self = this;
(<any>window).FirebasePlugin.verifyPhoneNumber(numIn, 60, function(credential) {
self.verifId = credential.verificationId;
console.log(" verificationId = ", verificationId)
});
}, function(error) {
console.error(error);
});
}
well, my problem is that
console.log(“code received”); is showing before
console.log(" verificationId = ", verificationId)
i want to wait until FirebasePlugin.verifyPhoneNumber() send SMS code then continue to the next line in the submitforOTP()
any help please ?
8 posts - 3 participants