Ioni c Firebase квота вопрос - PullRequest
       7

Ioni c Firebase квота вопрос

0 голосов
/ 01 марта 2020

Я пытаюсь использовать 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 голосов
/ 05 марта 2020

// здесь ошибка запуска //

const followDo c = this.angularFirestore.collection (AppUsers). Do c (this.fireAuth.auth.currentUser. uid) .ref;

Похоже, вы превысили квоту в запросе / подключении к базе данных, а не в аутентификации. Вероятно, вы более 100 подключенных пользователей одновременно

Чтобы увидеть больше : https://firebase.google.com/pricing/

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...