public WebListener() { FirebaseConfig config = new FirebaseConfig { BasePath = "https://splatmap.firebase.com/clouds" } cloudsClient = new FirebaseClient(config); // start listening await cloudsClient.OnAsync("push", (sender, args) => { System.Console.WriteLine(args.Data); }); }
private async void MainPage_OnLoaded(object sender, RoutedEventArgs e) { IFirebaseConfig config = new FirebaseConfig { AuthSecret = FirebaseSecret, BasePath = BasePath }; _client = new FirebaseClient(config); await _client.OnAsync("chat", added: (s, args) => { Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { TextBox1.Text = args.Data + " -> 1(ADDED)"; }); }, changed: (s, args) => { Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { TextBox2.Text = string.Format("Data :{0}, Path: {1} -> 1(CHANGED)", args.Data, args.Path); }); }, removed: (s, args) => { Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { TextBox3.Text = args.Path + " -> 1(REMOVED)"; }); }); await _client.OnAsync("chat", added: (s, args) => { Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { TextBox4.Text = args.Data + " -> 2(ADDED)"; }); }, changed: (s, args) => { Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { TextBox5.Text = string.Format("Data :{0}, Path: {1} -> 2(CHANGED)", args.Data, args.Path); }); }, removed: (s, args) => { Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { TextBox6.Text = args.Path + " -> 2(REMOVED)"; }); }); }
private async void ListenToStream() { IFirebaseConfig config = new FirebaseConfig { AuthSecret = "a9UxW4ZVfdJRGHHQ8NusZmTZ0c3NRZgSlrakVXXM", BasePath = "https://myxamarintest.firebaseio.com//" }; IFirebaseClient client; client = new FirebaseClient(config); await client.OnAsync("MyClass", (sender, args, d) => { //Gets the Unique ID and deletes the any other string attached to it string dataFromFB = args.Data; string paths = args.Path; /* string key = RemoveNameSubstring(paths); * string uniqueKey = key.Split('/').Last(); * if (keyHolder.ContainsKey(uniqueKey)) * { * keyHolder[uniqueKey] = dataFromFB; * AddToListView(dataFromFB); * } * else * { * keyHolder.Add(uniqueKey, dataFromFB); * AddToListView(dataFromFB); * }*/ }); }
private static async void EventStreaming() { await _client.DeleteAsync("chat"); await _client.OnAsync("chat", added : async(sender, args) => { System.Console.WriteLine(args.Data + "-> 1\n"); await _client.PushAsync("chat/", new { name = "someone", text = "Console 1:" + DateTime.Now.ToString("f") }); }, changed : (sender, args) => { System.Console.WriteLine(args.Data); }, removed : (sender, args) => { System.Console.WriteLine(args.Path); }); EventStreamResponse response = await _client.OnAsync("chat", added : (sender, args) => { System.Console.WriteLine(args.Data + " -> 2\n"); }, changed : (sender, args) => { System.Console.WriteLine(args.Data); }, removed : (sender, args) => { System.Console.WriteLine(args.Path); }); //Call dispose to stop listening for events //response.Dispose(); }
private async void MainPage_OnLoaded(object sender, RoutedEventArgs e) { IFirebaseConfig config = new FirebaseConfig { AuthSecret = FirebaseSecret, BasePath = BasePath }; _client = new FirebaseClient(config); await _client.OnAsync("chat", added : (s, args) => { Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { TextBox1.Text = args.Data + " -> 1(ADDED)"; }); }, changed : (s, args) => { Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { TextBox2.Text = string.Format("Data :{0}, Path: {1} -> 1(CHANGED)", args.Data, args.Path); }); }, removed : (s, args) => { Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { TextBox3.Text = args.Path + " -> 1(REMOVED)"; }); }); await _client.OnAsync("chat", added : (s, args) => { Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { TextBox4.Text = args.Data + " -> 2(ADDED)"; }); }, changed : (s, args) => { Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { TextBox5.Text = string.Format("Data :{0}, Path: {1} -> 2(CHANGED)", args.Data, args.Path); }); }, removed : (s, args) => { Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { TextBox6.Text = args.Path + " -> 2(REMOVED)"; }); }); }
private async void ContentPage_Appearing(object sender, EventArgs e) { if (Application.Current.Properties.ContainsKey("modo")) { var modo = Application.Current.Properties["modo"] as string; if (modo == "0") { wvPrincipal.Source = new Uri("https://pepeizqdeals.com/classic/?app=true"); } else { wvPrincipal.Source = new Uri("https://pepeizqdeals.com/?app=true"); } } else { wvPrincipal.Source = new Uri("https://pepeizqdeals.com/?app=true"); } IFirebaseConfig config = new FirebaseConfig { AuthSecret = "HtabeaAa9uFa0BN0uBQkBjy82MGcnhlVYVXjs1JM", BasePath = "https://pepeizq-s-deals-android.firebaseio.com" }; IFirebaseClient cliente = new FirebaseClient(config); EventStreamResponse response = await cliente.OnAsync("mensajes/", (s, args, context) => { CrossLocalNotifications.Current.Show(args.Data, "test"); }); }
public async void ListenFirebase(DataGridView gridBook) { EventStreamResponse response = await client.OnAsync("books", added : (sender, args, context) => { UpdateDataGridView(gridBook); }, changed : (sender, args, context) => { UpdateDataGridView(gridBook); }, removed : (sender, args, context) => { UpdateDataGridView(gridBook); }); }
public async void MesajKontrol() { try { FirebaseClient client = new FirebaseClient(config); EventStreamResponse eventStream = await client.OnAsync("Chat/" + Username.ToLower() + "/" + GidicekMesaj.ToLower() + "/RandomNumbers/", MesajGeldiginde); } catch { } }
public async Task Listen() { IFirebaseClient client = new FirebaseClient(config); EventStreamResponse response = await client.OnAsync("chat", (sender, args, context) => { System.Console.WriteLine(args.Data); }); //Call dispose to stop listening for events //response.Dispose(); }
private static async void EventStreaming() { await _client.DeleteAsync("chat"); await _client.OnAsync("chat", added : async(sender, args) => { System.Console.WriteLine(args.Data + "-> 1\n"); await _client.PushAsync("chat/", new { name = "someone", text = "Console 1:" + DateTime.Now.ToString("f") }); }, changed : (sender, args) => { System.Console.WriteLine(args.Data); }, removed : (sender, args) => { System.Console.WriteLine(args.Path); }); await _client.OnAsync("chat", added : (sender, args) => { System.Console.WriteLine(args.Data + " -> 2\n"); }, changed : (sender, args) => { System.Console.WriteLine(args.Data); }, removed : (sender, args) => { System.Console.WriteLine(args.Path); }); }
public async void Listener() // exemplo de um listener { IFirebaseClient firebase = new FirebaseClient(config); await firebase.OnAsync("ruptura", //added (sender, args, context) => { //MessageBox.Show(args.Data + " foi adicionado n/"); }, //changed (sender, args, context) => { MessageBox.Show(args.Path + " foi alterado de " + args.OldData + " para " + args.Data); }, // removed (sender, args, context) => { //MessageBox.Show(args.Path + " foi deletado"); }); }
private async void ListenToStream() { IFirebaseConfig config = new FirebaseConfig { AuthSecret = "a9UxW4ZVfdJRGHHQ8NusZmTZ0c3NRZgSlrakVXXM", BasePath = "https://myxamarintest.firebaseio.com//" }; IFirebaseClient client; client = new FirebaseClient(config); await client.OnAsync("mensajes", added : (sender, args, d) => { //Gets the Unique ID and deletes the any other string attached to it string dataFromFB = args.Data; string paths = args.Path; valores.Add(paths, dataFromFB); if (valores.Count >= 5) { Chat ct = new Chat(); ChatVM ctVM = new ChatVM(ct); for (int i = 0; i < valores.Count; i++) { if (valores.ElementAt(i).Key.EndsWith("MensajeChat")) { ct.MensajeChat = valores.ElementAt(i).Value; } else if (valores.ElementAt(i).Key.EndsWith("NombreChat")) { ct.NombreChat = valores.ElementAt(i).Value; } } ListViewData.Insert(0, ctVM); //ListViewData.Add(); // if (listaChat.Count >= 20) // { // } System.Diagnostics.Debug.WriteLine("Lista: " + ListViewData.Count.ToString()); // DisplayAlert("Alert", valores.ToString(), "OK"); valores.Clear(); } }, changed : (sender, args, d) => { //Gets the Unique ID and deletes the any other string attached to it string dataFromFB = args.Data; string paths = args.Path; } , removed : (sender, args, d) => { //Gets the Unique ID and deletes the any other string attached to it var dataFromFB = args; string paths = args.Path; }); }
public async void ListenFirebaseToken() { EventStreamResponse response = await client.OnAsync("user/" + DataStatic.user, changed : (sender, args, context) => { CheckToken(); }); }
private static async void EventStreaming() { await _client.OnAsync("chat", (sender, args) => { System.Console.WriteLine(args.Data); }); }