我正在尝试使用Facebook登录。但是它显示“ handleWindowVisibility:令牌android.os.BinderProxy@6a7e881没有活动”。并获取“ FacebookLoginStatus.error”。
facebookLogIn() async {
FacebookLogin fbLogin = FacebookLogin();
FacebookLoginResult result =
await fbLogin.logInWithReadPermissions(['email', 'public_profile']);
switch (result.status) {
case FacebookLoginStatus.loggedIn:
FacebookAccessToken myToken = result.accessToken;
AuthCredential credential =
FacebookAuthProvider.getCredential(accessToken: myToken.token);
await FirebaseAuth.instance
.signInWithCredential(credential)
.then((signedInUser) {
Navigator.of(context).pushReplacementNamed('/home');
}).catchError((e) {
print(e);
});
break;
case FacebookLoginStatus.cancelledByUser:
// TODO: Handle this case.
break;
case FacebookLoginStatus.error:
break;
}
}