Is there any way to store image data in a Firebase Database instead of adding it to Firebase Storage (maybe as a string then convert it when I need to use it)? This function adds the image data to my storage but I need to be able to call it when I call a specific document from my Database. Essentially, I want to use the image data like a field for my documents, or connect them some other way if possible. Thanks in advance.
func addImg(img: UIImage, name: String) {
let storageRef = storage.reference()
let artworkRef = storageRef.child("images/\(name)")
let data = img.pngData()
artworkRef.putData(data!, metadata: nil) { (_, err) in
if err != nil {
print((err?.localizedDescription)!)
return
}
}
}