[Firebase] Firebase Receiver throws event on rendering
Forge component by Labs

Hi,

My question is related to the messaging mechanism that firebase supports. When I have a record in the firebase database like:

"Firebase-Record-1": {
    "EventDateTime": "2019-01-23T11:59:56Z",
    "EventIdentifier": "1",
    "EventText": "Some Event",
    "EventType": "Type A"
  }

And I use the FirebaseReceiver with TargetIdentifier: Firebase-Record-1 I immediately get an event (The notify runs) when the web page with the web blocks loads. However, I would like to only get the event when this record changes. Is this behaviour "ByDesign" or can I change configurations to get the desired behaviour?

Kind regards,
Martijn Habraken

Hey, I also have this issue.

Also that event is never deleted so it kind of always triggers on every screen navigation.

Instead of changing the firebase event, i was curious on how other forge components that use Firebase deal with this so i checked the In App Chat Reactive component and this is what they did:


So basically on the ready call back event they save the date that it's returned, and then on event received they ignore all events that are before that date.

This works as a workaround, and I'm guessing the firebase component cannot be changed to take this into consideration because not sending past events on load would be a breaking change.

So basically if you need to know how to get around this check out how -> This Component <- does it.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.