我正在尝试使用ionic
使用Facebook OAuth登录,但是当我单击Facebook登录按钮时向我显示错误cordova_not_available
时出现问题
这是错误:
如果我在Android上的正式发布版本中使用该应用,则与Google OAuth的问题相同
import { Facebook, FacebookLoginResponse } from '@ionic-native/facebook/ngx';
private fb: Facebook,
facebookLogin() {
this.fb.getLoginStatus().then((res: any) => {
if (res.status == 'connected') {
console.log("user connected already" + res.authResponse.accessToken);
this.createAccount(res.authResponse.accessToken, 'fb');
}
else {
console.log("USer Not login ");
this.fb.login(['public_profile', 'email'])
.then((res: FacebookLoginResponse) => {
// this.alert.show('Logged into Facebook!' + JSON.stringify(res));
console.log("successfully login ");
this.createAccount(res.authResponse.accessToken, 'fb');
})
.catch(e => this.shared.showAlert('Error logging into Facebook' + JSON.stringify(e)));
}
}).catch(e => this.shared.showAlert('Error Check Login Status Facebook' + JSON.stringify(e)));
}
答案 0 :(得分:0)
尝试删除并重新安装插件,然后执行ionic repair