bugthesystem / FireSharp

An asynchronous cross-platform .Net library for Firebase
The Unlicense
693 stars 147 forks source link

listen OnAsync data of specific path #84

Open ahmadsety opened 7 years ago

ahmadsety commented 7 years ago

this code does not fire onAdded event , noChange event and removed

IFirebaseConfig config = new FirebaseConfig { AuthSecret = AuthSecret, BasePath = databaseURL }; IFirebaseClient _client = new FirebaseClient(config);

            List<VideoInformation> result = new List<VideoInformation>();

            await _client.OnAsync("uploadQueue",
                //added
                (sender, args, context) =>
                {
                    result = JsonConvert.DeserializeObject<List<VideoInformation>>(args.Data);
                },
                //changed
                (sender, args, context) =>
                {
                    result = JsonConvert.DeserializeObject<List<VideoInformation>>(args.Data);
                },
                // removed
                (sender, args, context) =>
                {
                    Console.WriteLine(args.ToJson());
                });