42,675 questions
1
vote
2
answers
140
views
Flutter Firestore: [cloud_firestore/permission-denied] on both iOS and Android despite open rules (if true)
I am facing a persistent [cloud_firestore/permission-denied] error in my Flutter app when trying to write/read from Firestore. This happens on both Android and iOS devices.
What I have tried so far:
...
3
votes
1
answer
106
views
Firestore queries taking a long time for a new field in document
I was querying for mentions of a user name with this query:
QuerySnapshot query = await profileRef
.where('name', isGreaterThanOrEqualTo: name)
.limit(8)
.get();
This query takes less ...
0
votes
1
answer
142
views
Firebase Firestore App Check and anonymous auth always return null
I have been working on this project and would like to add app check and auth. When app check and auth is not on the rules, the document is being saved. But when added docref appcheck is null. I am ...
1
vote
0
answers
109
views
Google Firestore DB always returns database not found
I created a Firestore DB in the Google Cloud Console and when trying to do AddAsync for the document I always get database not found.
the code I am using is below. Not sure what I am doing wrong. I ...
0
votes
1
answer
110
views
How do I access lists within an object of a variable read from a firestore database?
This is a question related to parsing list/array data. I can create and update collection documents and I can read the total collection of all documents. Once the collection is read, I can cycle ...
0
votes
0
answers
39
views
How do I parse data from a Firebase query snapshot? [duplicate]
In what format does Firebase firestore store data read from a database? My code is reading my whole database as I intend (I can see it in the query snapshot during debug mode of Android Studio) but I ...
0
votes
0
answers
75
views
How do I retrieve a list and extract the data from the result, into Jetpack Compose, of a FirebaseFirestore get() [duplicate]
I am having an issue extracting the data read from a Firebase database into the list (data class SitesList). The data is being read and is in Task<QuerySnapshot!> variable of the ....
0
votes
2
answers
145
views
Flutter web deployed on firebase is unable to receive any data though database streams
I am trying to deploy a flutter web application on firebase. In this minimum working example a stream from a collection should be returned and simply displayed.
When run locally, the object is ...
0
votes
1
answer
104
views
collection('attendance_report').get() returns empty snapshot even though data exists [duplicate]
I'm building an admin attendance viewer in Flutter using GetX and Cloud Firestore. The UI uses cascading dropdowns (Department → Semester → Section → Subject → Class Date → Attendance list).
The ...
1
vote
2
answers
102
views
Firebase CloudFirestore rules only work after reopening the app
I'm using Firebase Authentication and Firebase Cloud Firestore for my Flutter project. But the rules I implemented in the Firestore only apply correctly after restarting the app, if the user just ...
0
votes
0
answers
154
views
ERROR FIREBASE XCODE: Support Files/gRPC-C++/gRPC-C++-dummy.m module map file
After installing modules shown below I keep getting this error, after trying to run an app in Xcode:
firebase: 11.1.0
@react-native-firebase/app: 23.7.0
@react-native-firebase/auth: 23.7.0
@react-...
1
vote
2
answers
165
views
Firestore collection -> doc -> collection returning empty list in flutter
QuerySnapshot profilesSnap = await _firestore
.collection('users')
.doc(userId)
.collection('profiles').doc("default").collection("incomeRecords")
...
Advice
1
vote
1
replies
85
views
Firebase OnSnapshot Costs
I am pretty new to firebase and firestore and I just discovered onSnapshot method. I was wondering how much read an onSnapshot query is worth. I don't understand if it read the whole collection and ...
1
vote
0
answers
109
views
Firestore only updates when accessed through a specific Android activity
I'm working on an Android app where users can add and remove restaurants from their favourites via the RestaurantPage activity. When I access the RestaurantPage activity from the UserFavourites ...
0
votes
1
answer
77
views
Firestore rule to allow users to pull only chats they are members of?
I have chat documents like the following:
{
members: ['abc','def'] // 2 element list of member UIDs
// some other chat metadata
}
In firestore, I have the following rules on my collection:
...
Best practices
0
votes
3
replies
84
views
How to not write a Firestore Converter for each type. (Firestore + Unity / C#)
I am using Firestore and Unity, I want to be able to serialize a Unity class, say Vector2Int so I write a Vector2IntConverter(FirestoreConverter<Vector2Int>).
When I upload my DTO, say:
[...
1
vote
0
answers
76
views
Not able to save document using React Native 0.81.4 & firebase
I am using react-native 0.81.4 CLI along with the following Firebase packages:
"@react-native-firebase/app": "^23.5.0",
"@react-native-firebase/firestore": "^23.5.0&...
1
vote
0
answers
109
views
Error in firebase cloud functions document trigger using V2 functions: Failed to decode protobuf and create a before snapshot
I am migrating my Firebase Cloud Functions project from v1 to v2.
Since Auth triggers are not yet available in v2, I still have auth triggers in v1 — but all my Firestore triggers are now v2.
All of ...
2
votes
3
answers
159
views
Getting user properties from Firestore in Flutter app
I am trying to get several details from the collection "users" (eg, name, surname, nickname) stored in Firestore with the function getUserData() to pass them to other classes through the ...
0
votes
2
answers
149
views
Cannot connect to Firestore from Flutter project (Android)
I'm using Flutter in Visual Studio Code and Android Studio with a Pixel 6a emulator with Android 13 to preview the app.
Despite I could connect to other services of Firebase (Authentication, Storage, ...
0
votes
1
answer
106
views
Is there a way to handle situations where a user has blocked more than 10 users, so that the app doesn’t exceed Firestore’s not-in query limit?
func fetchNextPage() async {
guard !isLoading, !reachedEnd else { return }
isLoading = true
defer { isLoading = false }
let excluded = Array(BlockService.shared.blocked.prefix(10))...
1
vote
0
answers
273
views
Need help: "2 Unkown: Getting metadata from plugin failed with error: Could not refresh access token: Request failed with status code 500"
I have begun creating an application (Next.JS running on Firebase App Hosting) in Firebase Studio using Gemini and everything was working fine until now that I got a notification about "Client ...
0
votes
2
answers
203
views
Why does a decoded Date from Firebase have a small milliseconds offset in Swift?
I’m fetching a Date stored in Firebase (Firestore or Storage metadata) and decoding it in Swift, but I noticed the resulting value isn’t exactly what I expect.
// The date is created for midnight (00:...
3
votes
0
answers
108
views
ApiException 10 occurs only in Google Play version of Flutter app despite correct SHA-1 and Web client ID
I’m using Google Sign-In with Firebase in my Flutter app.
Here’s the situation:
I previously changed the app’s package name and updated it everywhere, reconfiguring Firebase accordingly.
When I test ...
0
votes
1
answer
98
views
Firebase: Fetching documents from a database that is not default, but is still in the same project
I've been trying to fetch documents from a different database I made on my project. I have my primary database which is called 'Default' and I have another database in the same project called 'Staging'...
0
votes
1
answer
213
views
Firestore not working on ADK agent deployed to Agent Engine
My ADK agent works fine locally when running on adk web, but the instance running on Agent Engine always fails to read and write data from firestore. I get an error saying 403 Missing or insufficient ...
0
votes
1
answer
68
views
Rules for checking document key existence in Firestore
So I have a document for an event. Here's the current structure:
{
"name": "Some Event Name",
"users" : {
"a": {
"name": "Some Name&...
0
votes
1
answer
81
views
Unexpected reads from Firestore upon signing in [duplicate]
14 Reads After the Login:
Query Insight at the time of Log In:
I am using basic email-password && google sign-in in my app. no other module yet. In my users collection there are only 3 ...
0
votes
1
answer
61
views
Firestore security rules: allow read only if custom claim pst is "true" or not present
I’m building a web app where users sign in with a Firebase Authentication custom token. The token has claims like this:
{
"iss": "------",
"sub": "------",
...
-1
votes
1
answer
76
views
Referencing by SHA256 unique documentID vs. referencing by the field that generated the unique SHA256 unique documentID [closed]
I’ve been working on a React/Firebase app for the past 10 months, and things have been smooth so far. Recently, I decided to do some refactoring.
I switched from using user-generated fields as unique ...
0
votes
0
answers
93
views
How to fix firebase firestore permission/rules error?
I am building a Flutter mobile app using Firebase backend. I have four collections: institutions, resources, resourceTypes, users.
I want the institution's collection to be accessible by any user (...
0
votes
0
answers
101
views
40% of Firebase User Registrations Missing Firestore Documents
I'm experiencing a critical issue with my NextJS/Firebase application where approximately 40% of random user registrations result in "orphaned" users - users that exist in Firebase ...
0
votes
1
answer
62
views
firestore Emulator database query results are incorrect/unstable
I am using the Google Firestore Emulator locally for development. However, when I query the database data, I find that the results are inconsistent and not correct each time. Here is the detailed ...
1
vote
1
answer
156
views
Firestore Security Rules resource.data is not returning correctly
I have a collection named "dms" that has "firstUserId" and "secondUserId" as fields in its documents. The following rule is giving me permission denied error:
match /dms/{...
0
votes
0
answers
35
views
Routing Issue: Transition to /category/smartphones/iphone Opens index.html Instead of category.html
I have a web application running on localhost:5000 using HTML pages (index.html and category.html) with dynamic component loading (e.g., header.html) via the loadComponent function. Links in the menu (...
0
votes
1
answer
99
views
Firestore transaction with multiple writes - is my syntax okay?
I am hosting a competition where groups of players (classes in a school) compete for points.
The players play individually and earns points for both themselves and for their class.
I track individual ...
0
votes
0
answers
199
views
Is it possible to test concurrent HTTP calls and Firestore side effects in Firebase Cloud Functions (Python, Gen 2)?
My goal is to write tests that:
Simulate multiple concurrent HTTP POST requests to a cloud function endpoint (e.g., 2-3 identical webhooks arriving almost simultaneously).
Verify database side ...
1
vote
0
answers
90
views
Attempted import error: 'dbAdmin' is not exported from '@/lib/firebase/admin' (imported as 'dbAdmin')
How do I properly initialize the Firebase Admin SDK with environment variables in Next.js / Node.js?
I'm trying to initialize the Firebase Admin SDK in a Next.js project using the environment ...
0
votes
1
answer
53
views
Firestore security: Incorrect number of arguments supplied to function: diff
I'm trying to use the diff() method in my Firestore rules to ensure the user only edits the allowed fields, however when I try to compile my rules and upload them, I receive the following error in my ...
1
vote
1
answer
115
views
Firebase Admin SDK db object is invalid in Vercel API Route ("Expected first argument to collection...")
I have a Next.js application on Vercel. My API route fails when calling Firestore's doc() function, but only when deployed to Vercel or when running the production build locally. The dev server (npm ...
0
votes
0
answers
52
views
Enforce firestore access for debugging
I have a Flutter app which accesses firestore data in a readonly way, and no user authentication is required for that data. There are some static information in firebase which can be updated without ...
0
votes
1
answer
155
views
Problem with using FirebaseFirestore - Missing required module 'FirebaseFirestoreInternalWrapper'
I'm using Firebase in my iOS project. In my AppDelegate, I have the following:
final class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication,
...
0
votes
1
answer
113
views
Getting the doc from the firestore isnt working as expected
Here is a pic of my firestore data.
I am running this query:
var settings = [];
const queryGetSettings = db.collection('Settings').doc("Category");
var query = queryGetSettings.get()
....
0
votes
1
answer
130
views
How the firestore support custom class and also custom class support FieldValue with typescript?
Firestore nodejs SDK supports custom class with typescript by withConverter. But only updateDoc support FieldValue, what about setDoc, addDoc?
For example:
class Post {
constructor(
...
0
votes
1
answer
104
views
Does Firebase Firestore charge for loading cached documents?
When I subscribe to a collection that results in 100 documents, a couple of days later, I start my app again. I am offline. I see all 100 documents because Firestore cached them for me. Then I go ...
0
votes
1
answer
78
views
Firebase Cloud Function fails with "TypeError: func is not a function" on deployment
I'm building a football match prediction system using JavaScript and Firebase. Users can make predictions on match results, and for users who don’t submit a guess, I want to automatically assign a ...
0
votes
1
answer
78
views
How to check if attribute matches in an array of maps
Previously, I had the following rule:
allow read: if request.auth.token.email in resource.data.shareWith;
Now, that the data structure changed and shareWith is no longer an array of email addresses, ...
0
votes
1
answer
58
views
How to remove a nested property from an object in Firestore
my firestore stores user data as below:
users (collection)
uid-123 (document one per user)
profile:
name: 'My Name'
options: {
x: 1,
y: ...
0
votes
1
answer
79
views
Convert anonymous Firebase Auth session on TV client to a signed‑in user via a separate authenticated client?
I’m building a multi-platform healthcare app where:
Mobile & Web portal share the same Firebase backend and allow individual doctors to view a single patient stream at a time.
Android TV client (...
1
vote
1
answer
108
views
Is It Safe to Use stream() Inside a Firestore Transaction in Python?
While conducting a code review today, multiple AIs advised against using the stream() function within a Firestore transaction in Python.
However, I couldn't find any mention of this limitation in the ...