适用于Android 7.0.0的Cordova Firebase身份验证失败

时间:2017-11-15 05:02:55

标签: android cordova firebase authentication firebase-authentication

我有一个Cordova应用程序,它使用Facebook,Twitter和Google的Firebase身份验证服务。我的代码基于此文档:https://firebase.google.com/docs/auth/web/cordova

到目前为止,它一直运行正常,除了本周我注意到在使用新的Android 7.0.0操作系统定位仿真器/设备时,所有3个提供商的Firebase身份验证在auth重定向回应用程序后失败。 (重定向工作正常,但永远不会调用Auth。$ onAuthStateChanged方法。)

我确认我的身份验证适用于运行Android 4.4(API 19)但不适用于7.0.0(API 24)的模拟器。

// provider == 'facebook' or 'twitter' or 'google'

Auth.$signInWithRedirect(provider).then(function(authData) {
  // User successfully logged in
  // check $onAuthStateChanged below
}).catch(function(error) {
  if (error.code === "TRANSPORT_UNAVAILABLE") {
    $scope.loading = true;
    Auth.$signInWithPopup(provider).then(function(authData) {
      // User successfully logged in
      // check $onAuthStateChanged below
    }).catch(function(error) {
      // This one didn't work either...
      $scope.err = error;
      $scope.loading = false;
    });
  } else {
    // Another error occurred
    $scope.err = error;
    $scope.loading = false;
  }
});

Auth.$onAuthStateChanged(function(authData) {
  // User successfully logged in
  if (authData) {
    $scope.loading = false;
  }
});

我需要对我的验证码进行更改以支持Android 7.0.0吗?

0 个答案:

没有答案