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

this.navCtrl.push() not working but alerts does

$
0
0

@lunneyd wrote:

this.navCtrl.push() is not working even though the alerts are. If I put alerts below the nav.push they don’t show. Why is this like every thing works par this.navCtrl.push(‘Page’);

return this.facebook.login(['email'])
      .then( response => {
        const facebookCredential = firebase.auth.FacebookAuthProvider
          .credential(response.authResponse.accessToken);

        firebase.auth().signInWithCredential(facebookCredential)
          .then( success => {
            console.log("Firebase success: " + JSON.stringify(success));
            firebase
              .database()
              .ref(`/userProfile/${success.uid}/email`)
              .set(success.email);
            console.log("Firebase success: " + JSON.stringify(success));
            firebase.auth().onAuthStateChanged(user => {
            if (user) {
              alert("his")
              firebase.database().ref(`/userProfile/${user.uid}/userType`).once("value").then(function (snapshot) {
                alert(snapshot.val())
              if (snapshot.val()!= null){
                
                alert("error1")
                 this.navCtrl.push('Page');
              }
              else{
                alert("error2")
                 this.navCtrl.push('Page2');
               
              }})}})```

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



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