1

i hope this question afford all the standards.Im trying to do a notification service using Firebease with the firesharp library.Im able to connect my app and insert data into my firebase, and, if i ask for an specific object, im able to retrieve the content,but is not what i need.The idea is being checking every last insert into the firebase and acordding to this notify the clients...the problem begin when i try to use QueryBuilder like this :

    public static void SelectAsync(string Query,Data Target)
    {

        FirebaseResponse response = client.Get(FireSharp.QueryBuilder.New("Information").OrderBy("ID").LimitToLast(1).ToQueryString());

        Data T = new Data();
        T=response.ResultAs<Data>();
        Console.WriteLine(T.ID.ToString());



    }

T ever return null

--The rules of my firebase

{ "rules": { ".read": true, ".write": true, "Information":{ ".indexOn":["ID"] } } }

I dont know where the problem is,i hope somebody can help me

ps: Calling the method

        private  async void button15_Click(object sender, EventArgs e)
    {


        FireBase Fire = new FireBase();
        Fire.Config();
        var data = new Data();
        await Task.Run(()=>FireBase.SelectAsync("Information",data));

    }

1 Answers1

1

Try to use GetAsync, it works for me.

private async Task button_RetrieveRangeData_Click()
{               
    FirebaseResponse resp1 = await client.GetAsync("Information", FireSharp.QueryBuilder.New().OrderBy ("ID").LimitToLast(1));
}
David Buck
  • 3,752
  • 35
  • 31
  • 35
Moshi ls
  • 26
  • 2