How did you solve it? I’m having this exact issue using Ionic 4 and testing on an Android 8.0 device. I followed @dayanajabif tutorial found in https://ionicthemes.com/tutorials/about/ionic-facebook-login . Route navigation is not working for some reason, it does work on other types of authentication I have on the app. Code example here:
private async nativeFacebookLogin() {
// the permissions your facebook app needs from the user
const permissions = ['public_profile', 'email'];
await this.facebook.login(permissions).then(response => {
const userId = response.authResponse.userID;
console.log('facebook response:', response);
this.uid = userId;
// Getting name and gender properties
this.facebook.api('/me?fields=name,email', permissions)
.then(user => {
user.picture = 'https://graph.facebook.com/' + userId + '/picture?type=large';
const email = user.email;
this.dataService.getUser(this.uid).subscribe((data) => {
console.log('user is:', data.data());
if (data.data() !== undefined) {
this.user = data.data();
this.deviceStorage.set('user', JSON.stringify(data.data()));
this.deviceStorage.set('uid', this.uid);
this.dataService.userNewListener(this.uid);
if (data.data().isNew) {
this.zone.run(() => {
this.router.navigate(['/profile']);
});
this.toastService.showToast('Please set up your profile first.');
} else {
this.zone.run(() => {
this.router.navigate(['/home']);
});
this.toastService.showToast('User has signed in successfully.');
}
} else {
this.dataService.addUser(this.uid, {email, uid: this.uid, isNew: true, isFb: true}).then(() => {
const obj = {email, uid: this.uid, isNew: true, isFb: true};
this.deviceStorage.set('uid', this.uid);
this.deviceStorage.set('user', JSON.stringify(obj));
this.toastService.showToast('Please set up your profile first.');
this.zone.run(() => {
this.router.navigate(['/profile']);
});
}).catch((err) => { console.log('facebookNerror 3 :' + err); });
}
});
}).catch((err) => { console.log('facebookNerror 2 :' + err); });
}, error => {
console.log(error);
}).catch((err) => {
console.log('facebookNerror 1 :' + err);
this.toastService.showToast('Native facebook error:');
this.toastService.showToast('Native facebook error:' + err);
});
}