skip to Main Content

Firebase – Firestore rules for not existing documents

Below code works if I have collection (in this case suppliers) function isNotRestrictedinSuppliers(){ let value=3; let suppliers=get(/databases/$(database)/documents/users/$(request.auth.uid)/settings/suppliers); return suppliers.data.suppliers_array.size() < value; //return true; } match /suppliers/{document=**}{ allow read,update, delete: if isSignedIn() && isValidUser(); //above is the same like allow write;…

VIEW QUESTION

Firebase – GoogleAuthProvider – Option to choose account

I'm working on a project in Flutter. I use this code: _googleAuthProvider.setCustomParameters({'prompt': 'select_account'}); UserCredential userCredential; if (kIsWeb) { userCredential = await _firebaseAuth.signInWithPopup(_googleAuthProvider); } else { userCredential = await _firebaseAuth.signInWithProvider(_googleAuthProvider); } On web I can choose which account I want to…

VIEW QUESTION

Firebase – Why the snapshot.data.documents can't be accessed while getting messages from Cloud Firestore through StreamBuilder?

The snapshot.data.documents can't be accessed while getting messages from Cloud Firestore through StreamBuilder. Code: class MessagesStream extends StatelessWidget { @override Widget build(BuildContext context) { return StreamBuilder<QuerySnapshot>( stream: _firestore.collection('messages').snapshots(), builder: (context, snapshot) { if (!snapshot.hasData) { return Center( child: CircularProgressIndicator( backgroundColor:…

VIEW QUESTION

Not find firebase import – Reactjs

This is my firebase.js import { initializeApp } from 'firebase/app'; import { getAuth } from 'firebase/auth'; import { getStorage } from 'firebase/storage'; import { getFirestore } from 'firebase/firestore'; const firebaseConfig = { apiKey: 'AIzaSyCUndICAUxUT3n_Q19F05BazSpLOkr2d1c', authDomain: 'chat-e7246.firebaseapp.com', projectId: 'chat-e7246', storageBucket: 'chat-e7246.appspot.com',…

VIEW QUESTION
Back To Top
Search