Hello,
Welcome to our Microsoft Q&A platform!
If you use FirebaseDatabase.net nugget package, this package do not provide any event to monitor the data change in the DB.
Then I find the native android have ValueEventListener
, So you can use this Xamarin.Firebase.Database
package in xamarin android.
public class MyValueEventListener : Java.Lang.Object, IValueEventListener
{
public void OnCancelled(DatabaseError error)
{
// throw new NotImplementedException();
}
public void OnDataChange(DataSnapshot snapshot)
{
// throw new NotImplementedException();
}
}
Then Add the data change event: DatabaseReference databaseReference = FirebaseDatabase.Instance.Reference; databaseReference.Child(Constants.ARG_CHAT_ROOMS).Ref.AddListenerForSingleValueEvent(new MyValueEventListener())
Here is an similar thread:
Best Regards,
Leon Lu
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.