@Velmurugan wrote:
I have two screens .
login
signup.
- In login screen, i am using actionsheet for otp verification.then i am using function for navigation to signup.
login page.
issue in signup page.
In the sign up page , if i am entering pin code , if it valid code it has to load three down below the pincode … I am hidin the three drop down combo usign ngif.
In console the values are loading but its not loading in HTML.If am removing the actionsheet , its working fine.
4.If i am directly navgiting to signup also its loading fine.here is my code…
login.ts
signIn(phoneNumber) {
const appVerifier = this.recaptchaVerifier; // this.isApp = !document.URL.startsWith('http'); const phoneNumberString = '+91' + phoneNumber.toString(); firebase.auth().signInWithPhoneNumber(phoneNumberString, appVerifier) .then( confirmationResult => { console.log('confirmationResult', confirmationResult); // SMS sent. Prompt user to type the code from the message, then sign the // user in with confirmationResult.confirm(code). this.alertwindow(confirmationResult, phoneNumber); }) .catch((error) => { console.error('Please check the mobile number', error); });
}
async alertwindow(confirmationResult, phoneNumber) {
const prompt = await this.alertCtrl.create({
message: ‘Enter the Confirmation code’,
inputs: [{ name: ‘confirmationCode’, placeholder: ‘Confirmation Code’ }],
buttons: [
{ text: ‘Cancel’,
handler: data => { console.log(‘Cancel clicked’); }
},
{ text: ‘Send’,
handler: data => {
confirmationResult.confirm(data.confirmationCode)
.then((result) => {
// User signed in successfully.
console.log(‘User signed in successfully.’);
console.log(result.user);
console.log(result.user.uid);
console.log(result);
this.storage.set(‘username’, phoneNumber);
this.storage.set(‘userToken’, result.user.uid);
this.getUserStatus(phoneNumber);
// …
}).catch((error) => {
// User couldn’t sign in (bad verification code?)
// …
alert(‘couldnt sign in’);
console.log(error);
});
}
}
]
});
return await prompt.present();
}public getUserStatus(userData) {
console.log(userData);
this.authService.getUserStatus(userData)
.then(data => {
const value = JSON.stringify(data[0]);
this.response = JSON.parse(value);
console.log( this.response);
console.log( this.response.status);
if (this.response.status === ‘new’) {
this.navCtrl.navigateRoot(’/signup’); // new user
}
if (this.response.status === ‘old’) {
this.storage.set(‘signup’, ‘YES’);
this.storage.set(‘userToken’, this.response.usertoken);
this.storage.set(‘username’, this.response.username);
this.storage.set(‘fullname’, this.response.fullname);
this.navCtrl.navigateRoot(’/tabs’);
}
});
}
Posts: 1
Participants: 1