Can anyone help me in this problem . So I have a code for Firebase Storage using metadata, on Swift 4
Here is the code :
let imageName = NSUUID().uuidString
let storageRef = Storage.storage().reference().child("profile_images").child("\(imageName).png")
if let uploadData = UIImagePNGRepresentation(self.profileImageView.image!) {
storageRef.putData(uploadData, metadata: nil, completion: { (metadata, error) in
if error != nil {
print(error)
return
}
if let profileImageUrl = metadata?.downloadURL()?.absoluteString {
let values = ["name": name, "email": email, "profileImageUrl": profileImageUrl]
self.registerUserIntoDatabaseWithUID(uid, values: values as [String : AnyObject])
}
print(metadata)
})
and i have error in :
if let profileImageUrl = metadata?.downloadURL()?.absoluteString
the error :
Value of type 'StorageMetadata?' has no member 'downloadURL'
This is the screenshot of my code click here
Is there a solution , thanks anyway