Click here to Skip to main content
15,741,947 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Im trying to create a table that will store the reference of the image in Firebase storage! The image is being uploaded and stored in Firebase Storage but I cant create the table to reference it in my database

Here is my code:

What I have tried:

private async void UploadPhoto()

        if (filePAth != null)
            progressDialog = new ProgressDialog(this);

            var images = storageRef.Child("images/" + Guid.NewGuid().ToString());


public async void OnSuccess(Java.Lang.Object result)
        //get the logged on user so we know who made the category
        var user = FirebaseAuth.Instance.CurrentUser;

        //Link the photo in storage to database reference 
            var newImageDetails = storageRef.Child("images");
            Photo photos = new Photo();
            photos.categoryId = newImageDetails.Name;
            photos.photoId = newImageDetails.Name;
            photos.tagName = addTag.Text;

            if (user != null)
                var uid = user.Uid;
                //set the users id to the category
                photos.uid = uid;

            var firebase = new FirebaseClient(FirebaseURL);
            var item = await firebase.Child("photos").PostAsync(photos);

        catch (System.Exception e)


        Toast.MakeText(this, "Successfully uploaded image", 

When I test with breakpoints the code says that the items are null in the try catch block?

Im trying to get the reference of the newly uploaded image!
Updated 26-Aug-17 3:37am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900