离子火力基地配额问题

时间:2020-03-01 03:56:48

标签: angular firebase ionic-framework

我正在尝试使用Firebase身份验证(Google和Facebook)和Firestore。我认为它是免费的,为什么我会收到此错误

Uncaught (in promise): FirebaseError: [code=resource-exhausted]: Quota exceeded.
FirebaseError: Quota exceeded.

我的身份验证服务代码

   onLoginSuccess(res: FacebookLoginResponse) {
    const credential = firebase.auth.FacebookAuthProvider.credential(res.authResponse.accessToken);
    this.fireAuth.auth.signInWithCredential(credential)
      .then((response) => {
      console.log(response);

        this.fb.api('me?fields=id,name,email,first_name,picture.width(720).height(720).as(picture_large)', []).then(profile => {
        this.userData = {email: profile['email'], first_name: profile['first_name'], picture: profile['picture_large']['data']['url'], username: profile['name']}
        console.log(this.userData);
        console.log(this.fireAuth.auth.currentUser.uid);

          let userData =  {
          email: this.userData.email,
          username: this.userData.username,
          photo: this.userData.picture,
          phone: '',
          point : '0',
        win : '0',
        lastLogin: new Date(),
          uID: this.fireAuth.auth.currentUser.uid
        };

//here the error start //
    const followDoc = this.angularFirestore.collection(`AppUsers`).doc(this.fireAuth.auth.currentUser.uid).ref;

    return followDoc.get().then((doc) => {
      if (doc.exists) {
          console.log('old user');
          this.router.navigate(["/select"]);
      } else {
          console.log('new user');
          this.angularFirestore.collection('AppUsers').doc(this.fireAuth.auth.currentUser.uid).set(userData);
          this.router.navigate(["/select"]);
      }
    }); 
//here the error end //

      })

  });
  }

我尝试添加所有代码。我在Firebase中使用的是Facebook登录名,Google登录名,云消息传递以及用于存储Firebase存储。我的总用户现在已经接近300。我认为Facebook或Google登录是免费的,因此不会引起问题。

1 个答案:

答案 0 :(得分:0)

//这里错误开始//

const followDoc = this.angularFirestore.collection(AppUsers)。doc(this.fireAuth.auth.currentUser.uid).ref;

看起来,您超出了数据库查询/连接的配额,而不是身份验证中的配额。您可能同时超过100个已连接用户

要查看更多信息: https://firebase.google.com/pricing/