rlamasb / Firebase.Xamarin

Light weight wrapper for Firebase Realtime Database REST API.
MIT License
149 stars 39 forks source link

I can not query. #30

Open ghost opened 7 years ago

ghost commented 7 years ago

I' use Xamarin.Forms and I just want to query. but I keep seeing this error that 'An unhandled exception occured.' Do not you use this plugin on Xamarin.Forms?

    async private void Load_Clicked(object sender, EventArgs e)
    {
        await LoadData();

    }
    public class FirebaseMemo
    {
        public string Memo { get; set; }
    }

    private async Task LoadData()
    {

        var firebase = new FirebaseClient("https://xamarinproject-176e8.firebaseio.com/");
        var items = await firebase
            .Child("Memovalue")
            .OnceAsync<FirebaseMemo>();

        foreach (var item in items)
        {
            FirebaseMemo Acc = new FirebaseMemo();
            Acc.Memo = item.Object.Memo;
            TextLabel.Text = Acc.Memo;

        }
    }
johnjake commented 6 years ago

I know this is late but I still would like to answer did you set rules in your firebase ? if you set to auth!=null then the problem is your token.