bugthesystem / FireSharp

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

Subscribe #105

Open rajkovicbojan opened 6 years ago

rajkovicbojan commented 6 years ago

Hi,

I have one question . I want to recieve only notification. The question is actualy how to subscribe on topic and which function to use for receiving notifications.

Please if you coulde give some basic example.

fabricciotc commented 5 years ago

Hi, its easy:

EventStreamResponse response = await _client.OnAsync("chat", (sender, args, context) => { System.Console.WriteLine(args.Data); });

fabricciotc commented 5 years ago

If you want a notification only change System.Console.WriteLine to a MessageBox. Obviously if you are using a WPF o a windows forms.