How to remove all listeners from Firebase in C #?

In my project, I have quite a few listeners to listen to any changes in the database in real time. For some reason, these listeners remain even if I reload the scene using

Application.LoadLevel("mainScene");

It would be hassle enough to remove each listener individually, using

FirebaseDatabase.DefaultInstance
    .RootReference
    .Child("sub path 1")
    .Child("sub path 2")
    .ValueChanged -= SomeFunction;

FirebaseDatabase.DefaultInstance
    .RootReference
    .Child("path")
    .ValueChanged -= AnotherFunction;

Is there a way to remove listeners from all paths?

+4
source share
1 answer

On most platforms, the Firebase SDK has a call to remove all handlers from a location. But from a quick scan, such a method does not seem to be available in the Unity SDK. If it might be worth filing a feature request .

, #, DatabaseReference, .

0

Source: https://habr.com/ru/post/1678030/


All Articles