Home > database >  Firebase Realtime Database OnSnapShot functionality through REST?
Firebase Realtime Database OnSnapShot functionality through REST?

Time:10-20

I am making a react-native (expo) chat app. Throughout the app including Auth-work , Users-work, etc, I have used Firebase Rest API to do all the work. Now in the messaging section, I am using react-native-gifted-chat I have made the sending messaging functionality and I am storing my Messages like this.

FireBase storing Messaging

Like in the firebase package, we can do something like onSnapshot() but is there a way to do the same In the rest API. If not, what should I do if I don't want to install firebase and only work through rest API. In Conclusion: I want to ask is there a way in firebase rest API to do something when a node changes (like Chatroom node)

Any help will be appreciated Thanks in advance

CodePudding user response:

If you want to listen for updates through REST, you can use the streaming REST API, which delivers this functionality through Event Source/Server Sent Events.

Implementing this is typically quite a bit more involved than using a Firebase SDK, so if an SDK is available for your platform, I recommend using that.

  • Related