Firebase API questions (for Unity) [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
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

Related

Realtime database: how to add data from one reference to another reference? [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 7 months ago.
Improve this question
How add this -N8O6lC8cGgMfLE_8BIR data from the reference Colis Futur to reference Colis Requetes
Here's what should happen. just below
If you want to copy a RTDB node from one parent node to the another one, you need to first read it from the source parent node and then write the node (it's value + key) under the parent target node.
How to do that depends on your exact techno/functional requirements. You could do that from your front end, if for example you app is a "Colis" management app or you could do that in the back-end with a Cloud Function, for example if you want to denormalize your data according to the NoSQL "philosophy".

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.

Flutter Firebase realtime once().then() doesn't get updated when rerun [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
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.

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

Track record/document changes? [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 5 years ago.
Improve this question
It doesn't appear to be built-in to Meteor but is there an accepted way to track changes to a record/document? I can think of a number of ways to do this but am curious how others have accomplished this.
An example would be someone's location, if you wanted to track changes for a set period of time.
Thanks!
I haven't tested this package yet but it seems to track revisions and give the ability to restore older versions. I'm going to test it out now.
https://github.com/todda00/meteor-collection-revisions
Update: I can confirm that this package works in Meteor 1.3. It makes a complete copy of the document of the edited Meteor collection and stores it as an array within the document under "revisions". You can then restore any previous version using the revisionId later on.

Resources