I have the following code:
let storageRef = FIRStorage().reference(forURL: \"gs://slugbug-....appspot.com\") // dots intentional
let imageRef = storageRef.ch
Use below code work
// call storage ref from link
self.storageRef = FIRStorage.storage().reference(forURL: "your_URL")
// Assuming your image size < 10MB.
self.storageRef.data(withMaxSize: 10*1024*1024, completion: { (data, error) in
if data != nil{ // if image found
let photo = UIImage(data: data!)
// User photo here
}
})
You are missing .storage()
.
Check your line. It should be:
let storageRef = FIRStorage.storage().reference(forURL: "gs://slugbug-....appspot.com") // dots intentional
Hope it helps
I figured out the solution:
I changed the code from:
let storageRef = FIRStorage().reference(forURL: "gs://slugbug-....appspot.com")
to:
let storageRef = FIRStorage.storage().reference(forURL: "gs://slugbug-....appspot.com")
... a very subtle but annoying bug