I have code which saves multiple images into firebase. I updated my pods, and after this I had to change my downloadURL code. After doing so the urls are not showing up in t
You are probably using a different URL storage ref for the put data method the two blocks are within.
You may have something like this where childStorageRef is a different ref than storageRef:
childStorageRef.putData(uploadData, metadata: nil) { (metadata, err) in
storageRef.downloadURL { (url, error) in
if error != nil {
print("Failed to download url:", error!)
return
}
let imageUrl = "\(String(describing: url))"
postRef.child(autoID).setValue(imageUrl)
}
}
Change that ref to this:
storageRef.putData(uploadData, metadata: nil) { (metadata, err) in
storageRef.downloadURL { (url, error) in
if error != nil {
print("Failed to download url:", error!)
return
}
let imageUrl = "\(String(describing: url))"
postRef.child(autoID).setValue(imageUrl)
}
}
Same thing for block 2. Hope this helps!