如何在图像插入firebase.storage后获取下载URL

问题描述 投票:0回答:1

我能够将图像插入到firebase.storage中,但我获得的下载链接与上传时附加到图像的下载链接不同。

public void UploadImage()
{
    if (filePath != null)
        progressBar.Visibility = ViewStates.Visible;
    var images = storageRef.Child("profilePicture");
    images.PutFile(filePath);    
}

void IOnSuccessListener.OnSuccess(Java.Lang.Object result)
{
    var snapShot = (UploadTask.TaskSnapshot)result;
    var downloadURL = snapShot.DownloadUrl.Scheme
        + ":" + snapShot.DownloadUrl.SchemeSpecificPart;
}

UserData newUser = new UserData();
newUser.UserId = UserId;
newUser.Email = UserEmail;
newUser.FirstName = first.Text;
newUser.LastName = last.Text;
newUser.MobileNumber = phone.Text;
newUser.Userprofile = storageRef.DownloadUrl;
xamarin.android firebase-storage
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.