Flutter Firebase realtime once().then() doesn't get updated when rerun [closed] - firebase

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Flutter Firebase realtime once().then() doesn't get updated when rerun
when I use once.then to read data if I run it again it won't update variables or give out null

The once() method does precisely what its name implies: it reads the data once, and doesn't monitor for updates. As the documentation says:
Listens for a single value event and then stops listening.
To get realtime update, use one of the on... streams such as onValue which:
Fires when the data at this location is updated.

Related

Using for loop with firebase sdk in flutter [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Can we achieve by querying snapshots of all documents in a collection that seen and whose values are set to be false using for loop? Or will we have to use firebase functions for that? Thank you.
For ChatApp you can add a is seen attribute to your message like the below:
-La42yee6vzxZ2hbZy2R
isseen: true
message: "u"
reciever: "7bVO6TsEJtTPaO2bRqWL6ZzFrkg1"
sender: "4z27uqrIVCMJ96hfI6Y5qzIxHav1"
When the sender send a new message you must set isseen property to false, and when the receiver opens the chat page you must change isseen to true.
I hope this work for you.

Why my read count is increasing in Firebase database? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Currently I'm only checking for the data is available or not in the firestore database. I haven't stored any data for the id I am checking for.
But still count is increasing.
I would expect the "checking for data is available" is executing a read to see that it is or isn't there.
Per Googles docs.
Minimum charge for queries
There is a minimum charge of one document read for each query that you perform, even if the query returns no results.
Link to the doc.
https://firebase.google.com/docs/firestore/pricing#minimum-charge

Firebase API questions (for Unity) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
While it is super cool to work with Firebase in Unity, it is quite a learning curve.
Two questions have come up that I think are both general and important in the way Firebase is used:
Can any Firebase developers enlighten these?
If you set a Firebase Query to null, will it also set all listener events attached to that query to null?
Can you always use -= to remove an eventhandler, EVEN if this is not set? Is there a way to check if a query already has an Eventhandler (like ValueChanged) attached?
Best regards
Ole
you set a Firebase Query to null, will it also set all listener events attached to that query to null?
No. You will need to explicitly remove the listeners as shown here: How to remove all eventhandler

How to automate the process of generating daily report from firebase? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
For example, to automate the process of producing a daily report for selected events and the duration of time that unique users spend on some specific event. And it is even better if I can customize the reporting information and have it generated in excel sheet automatically. Any suggestions or ideas would be much appreciated.
You could use a Cloud Function to generate you excel report, for example by using excel4node (https://www.npmjs.com/package/excel4node)
And to call this Cloud Function regularly, you have to trigger it via http through a cron-job.
Have a look at:
https://firebase.google.com/docs/functions/http-events).
and
https://www.youtube.com/watch?v=CbE2PzvAMxA
Note: What works quite well too is to generate some PDFs via the Cloud Function, using pdfmake.

Firebase: How to know if a user used the app within 4 weeks [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Using Firebase as a backend for my mobile app, how can I get the information (on the client side) if a user was using my mobile-app within the last 4 weeks or if he didn't?
I somehow need to get the date of last usage (last read, or write operation, last login...)
I know there is the information of "last sign-in" in the admin SDK, however I'm not sure if this is supposed to be integrated in the app itself.
you can add lastOnline field to your user entity and change it everytime the user quit the application :
DatabaseReference userLastOnlineRef = FirebaseDatabse.getInstance().getReference("users/joe/lastOnline");
userLastOnlineRef.onDisconnect().setValue(ServerValue.TIMESTAMP);
link

Resources