Reputation: 6035
The task I want to accomplish is the following: Change some fields in the Parse dashboard and make the app respond right after. So pretty much make the UI respond to a change in the server.
After searching for a while, I see that I should set it up through Parse Cloud Code and use methods like afterSave
. But as of now, I understand how to listen to an object being saved. How should I manage to do it the opposite way, which is the app listen to a change in the server? I will be manually changing some variables in the Parse Dashboard and I want the user to be able to get it whenever I manually change it. I could set up a timer (as a method inside the app’s code) and check it from the server in a 5 seconds interval but that would be pretty much inefficient in terms of requests, internet data.
Upvotes: 1
Views: 824
Reputation: 71
You have few solution choice. I dont know your architecture and your technologies what you use but I wrote two solutions.
silent notification with push server: You need a push server on backend and you can send a silent push to frontend when the afterSave code triggering. However frontend code should be subscribe your push server. e.g.: https://justmarkup.com/log/2017/02/implementing-push-notifications/
websocket communication: You need a socket server on backend and a socket client on frontend and if you have a channel then you can send a message to client from server. e.g.: https://blog.idrsolutions.com/2013/12/websockets-an-introduction/
I hope It will be help you.
Upvotes: 1