I want to create a conversation with the firebase, but the problem is that the two parties (the users) are in two different applications, meaning when the first party of the first application sends a message, I want it to reach the second application, how do I achieve that?
Asked
Active
Viewed 68 times
0
-
You might want to check out Cloud Functions. You can call the function with a http request / trigger from within your app. So a Cloud Function for app 1 that is called from within app 2 and vice versa – BJW Oct 08 '21 at 15:08
-
The question is vague as we don't know what "two applications" means - applications you wrote? Are they both backed by Firebase? Are they both connected to the same Firebase Database? which Firebase product(s) are you using? Is this specifically related to cloud messaging? If so, you may want to re-read the documentation to ensure that's the right solution for your chat app [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/). Also read [this question](https://stackoverflow.com/questions/53973441/how-to-use-fcm-topics-for-notification-in-chat-app) and Franks answer. – Jay Oct 09 '21 at 13:55
1 Answers
0
You need to use a stream in your application. Firestore queries have a .snapshots() method which is a stream and you can wrap it with a StreamBuilder to get a continuous flow of data from the database. I might not be able to give you a full explanation here, but you should check the FlutterFire Docs for full understanding of realtime reads.
Check it here: https://firebase.flutter.dev/docs/firestore/usage#realtime-changes

Intellect
- 125
- 7