I have tried all options I can to fix this code but nothing works for days.
I have this code that was made with firebase storage version 15.0.2 before getDownloadUrl() got deprecated
String imageTitle = ImageUtil.generateImageTitle(UploadImagePrefix.PROFILE, profile.getId());
UploadTask uploadTask = databaseHelper.uploadImage(imageUri, imageTitle);
if (uploadTask != null) {
uploadTask.addOnCompleteListener(task -> {
if (task.isSuccessful()) {
Uri downloadUrl = task.getResult().getDownloadUrl();
LogUtil.logDebug(TAG, "successful upload image, image url: " + String.valueOf(downloadUrl));
profile.setPhotoUrl(downloadUrl.toString());
createOrUpdateProfile(profile, onProfileCreatedListener);
} else {
onProfileCreatedListener.onProfileCreated(false);
LogUtil.logDebug(TAG, "fail to upload image");
}
});
I don't know how to re edit this code to work with the latest version, every from I try to change to the latest Storage reference, I get error
I am politely asking for help, I will be grateful