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 years ago.
Improve this question
just wondering how to retrieve data writed by a specific user using angular2 and firebase without using filter and map. if there is a way.
I think that you could use the equalTo query:
var ref = new Firebase('https://something.firebaseio.com/posts');
ref.orderByChild('sender').equalTo('some user').on("child_added", (snapshot) => {
console.log(snapshot.key());
});
In this case, a sender attribute must be present
See this link for more details:
https://www.firebase.com/docs/web/api/query/equalto.html
Related
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.
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
I want to upload array of data into firebase using flutter I do not know how to upload array of data from firebase please help me to solve this by providing some examples of codes.
Here is a example to upload data to Firestore using Dart (Flutter):
static example() async {
var array = ["item1", "item2"];
await FirebaseFirestore.instance.ref
.collection("myCollection")
.doc("myDocument")
.set({"myArray": array});
}
Find more about data types and firestore here: https://firebase.google.com/docs/firestore/manage-data/data-types
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 am writing a cloud function, i need a way to get the device id tokens of some devices, which i have stored in a field of a collection in a document.
How can I access it?
Please help, i'm stuck at this.
You can try code:
firebaseMessaging.getToken().then((token) {
Firestore.instance.collection('collectionName').document(currentUserId).updateData({'pushToken': token});
})
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
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 8 years ago.
Improve this question
I want to write an application that stores the contact list records, that user enters, so that the user will later be able to import them from within Symbian (and/or Android) phone. What I'm asking is: is this possible and if so, what the format of stores should be in order to import records? Any help is appreciated.
Yes, it is possible. What you need is the Contacts API. You can find answers to your questions in the documentation.