4

This is the current Firebase/Firestore data model I am using for my test chat application. However, this model is very hard to use for push notifications on Android side. I want to send push notifications to users phone when they receive messages from any of the channels they are part of. In addition file/image messages need to be added.

Any recommendations or any examples of good data models for chat applications I can use as a reference.

Firestore data model

Alex Mamo
  • 130,605
  • 17
  • 163
  • 193
Patola
  • 515
  • 8
  • 30
  • You can refer https://firebase.google.com/docs/functions/use-cases#notify_users_when_something_interesting_happens – Sushant Somani Oct 08 '18 at 07:41
  • I was hoping to write a background service to listen to a snapshot of Channel data and then create notifications on android. Is this a wrong approach. – Patola Oct 08 '18 at 07:52

1 Answers1

9

If you want to try another approach regarding a Cloud Firestore database schema, here you can find a tutorial on how you can structure the database for a Chat App.

I have also exaplained in another tutorial of mine, step by step, how you can send notifications to specific users using Cloud Firestore and Node.js. You can also take a look at my answer from this post.

Alex Mamo
  • 130,605
  • 17
  • 163
  • 193