Hi,
I am trying to use firebase realtime database to fetch data at realtime on all devices at once. I have my logic written in the AddOnClick client action. When I try to update the data, it runs smoothly but gives the following error while fetching it. Also I don't have any Idea on where to use the GetRealtimeData client action provided by the Forge component. I am using the action in the AddOnClick itself.
My data is reflected in the firebase console. But unable to fetch in my application.
Please find attached oml file and help me get rid of this error.
Thanks,
Nikhil Kawde
If you're using the GetRealtimeData action inside your AddOnClick client action, that might be the root of the issue. GetRealtimeData is meant to set up a real-time listener and should ideally be used once—like in the screen's OnReady or OnInitialize—not on a button click. Otherwise, it can cause conflicts or repeated listeners, leading to fetch errors.
Try moving GetRealtimeData to the screen’s initialization flow and keep AddOnClick for updates only. Also, make sure your Firebase rules allow read access. I’d be happy to help further if needed!
Thanks, Nikhil