Created
April 9, 2020 06:46
-
-
Save hkusoft/dc6b63a2d51dc4425d35e0e9e84b3942 to your computer and use it in GitHub Desktop.
How to subscribe Firebase realtime DB event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//client1 = new FireSharp.FirebaseClient(new FirebaseConfig(...)); | |
client1.OnAsync(StringPath, Added, Changed, Removed); | |
private void Removed(object sender, ValueRemovedEventArgs args, object context) | |
{ | |
Log(args.Path + " removed"); | |
} | |
private void Changed(object sender, ValueChangedEventArgs args, object context) | |
{ | |
Log(args.Path + " changed from " + args.OldData + " to " + args.Data); | |
} | |
private void Added(object sender, ValueAddedEventArgs args, object context) | |
{ | |
Log(args.Path + " added"); | |
} | |
private void Log(string info) | |
{ | |
InfoBox.Text += Environment.NewLine + info; //InfoBox is a ListBox UI control | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment