为什么显示“ handleWindowVisibility:令牌android.os.BinderProxy@c63b265没有活动”?

时间:2019-09-02 09:03:13

标签: facebook firebase flutter

我正在尝试使用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;
 }
}

0 个答案:

没有答案