Skip to content

Listening to multiple nodes #153

Answered by george-kar
george-kar asked this question in Q&A
Discussion options

You must be logged in to vote

I was able to listen two different nodes but using two IFirebaseEvent and one IRealTimeDB, instead of two IRealTimeDB instances as you proposed. I think its much better. Example code for other users:

fAuth := TFirebaseAuthentication.Create('apikey');
  fRealTimeDB := TRealTimeDB.CreateByURL('https://...', fAuth);

  fFirebaseEvent := fRealTimeDB.ListenForValueEvents(
    SplitString(edtRTDBEventPath.Replace('\', '/'), '/'),
    OnRecData, OnRecDataStop, OnRecDataError);

  fFirebaseEvent2 := fRealTimeDB.ListenForValueEvents(
    SplitString(edtRTDBEventPath2.Replace('\', '/'), '/'),
    OnRecData, OnRecDataStop, OnRecDataError);

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@george-kar
Comment options

Comment options

You must be logged in to vote
1 reply
@SchneiderInfosystems
Comment options

Answer selected by george-kar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants