Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48979

Wait the end of a function before to start the next ionic 3

$
0
0

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

Read full topic


Viewing all articles
Browse latest Browse all 48979

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>