I want to achieve following functionality : I have data that is displayed to users, one user can change the data and I want all other user to see the changed immediately. I want real time communication between users. I thought, since I use Firebase Cloud Messaging, to send notification to all users and on “pushNotificationReceived” event I update their data.
My question is: Is this good solution to the problem, what would be the better way?
Also since I send Push Notification using Firebase, it is displayed to user, is there a way to send it without showing Push Notification to user just so event triggers and I update information.
@EinfachHans Hey, I have one more question for you. When I register token from client app it is stored on backend. Is it possible that Firebase invalidates token or do they have expiry date. If yes how can I know when this happens so I can notify my backend to change token for new one?
@Tommertom
I am using Firebase only for FCM. I have my Laravel backend.
One user adds a number to total store i need to notify all other users in same group about it and add +1 to their store as well. In this scenario would you suggest i keep with Firebase notification for real time updates or something else. What would you suggest?
If u have to stick to laravel then i cant tell the best way how to trigger updates for a larger group. I dont know laravel backends. Likely there is a laravel solution to this?
Using fcm without user notifications- maybe a bit off? But if hans says it works, why not. Not sure if u can disable the notification while still getting the push. Maybe in message config?
In firestore the realtime updating is a default feature and pretty cool. If u like that, maybe ditch laravel? Or even put firestore in between? Or next to the laravel api?
We are using Push but that doesn’t mean that it’s the best Can you share some information about firestore realtime updates also in cordova/capacitor apps? Always happy to learn new stuff
Uhhh…. I use firebase web sdk to access data in firestore. Via angularfire wrapper
A doc(‘pathtodoc’).valueChnges() gives a stream of that doc. Whenever another app or server changes that doc, all who are subscribed to the stream will get those changes almost realtime. All with rxjs magic
No not yet. Our App is highly important to run and receive updates even after hours in background mode. It’s a emergency app, so stuff like this has to work perfectly over hours Even with internet connection losses and resuming…
Actually when you send data notification there is nothing displayed. It is silent and i can do whatever i want with data. There isnt even push when app is in background.
Also reimplementing everything to use firestore seems ineficent since my app and real time part doesnt need to be exact in milisecond or even few seconds.
But thanks for info will defenitely look i to ir for future projects.
Do you by any chance use distance calculation in your app? If so which plugin you use?
I have distance calculation using some formula using lat and lng but its not calculating distance using roads like an google mapa does. It just calculates air distance which is not always 100% exact.