title: user does not have permission to access gs:// xxx.appspot.com
body: <p>In this application I created authencation, database with firebase. but in my post, which consists of title, content, and image, I only see my default image. I'm having a bit of a problem with storage in the database, first uploading the image to firebase storage and then taking its url.</p>
  <pre><code>import Foundation
  import SwiftUI
  import Firebase
  import FirebaseStorage
  
  class StorageStore: ObservableObject {
  let storageRef = Storage.storage().reference()
  
      func uploadImage(_ image: UIImage, completion: @escaping (URL?) -&gt; Void) {
          let imageRef = storageRef.child(&quot;images/&quot;+timeString()+&quot;.jpg&quot;)
          
          guard let imageData = image.jpegData(compressionQuality: 0.1) else {
              return completion(nil)
          }
          let metadata = StorageMetadata()
          metadata.contentType = &quot;image/jpg&quot;
          
          imageRef.putData(imageData, metadata: metadata, completion: { [self] (metadata, error) in
              if let error = error {
                  assertionFailure(error.localizedDescription) //   
   //Thread 1: Fatal error: User does not have permission to access gs://ios-post-193ec.appspot.com/images/2022-03-29T10:03:18Z.jpg.
                  return completion(nil)
              }
              imageRef.downloadURL(completion: { (url, error) in
                  if let error = error {
                      assertionFailure(error.localizedDescription)
                      return completion(nil)
                  }
                  completion(url)
              })
          })
      }
      
      func timeString() -&gt; String {
          let now = Date()
          let formatter = ISO8601DateFormatter()
          let datetime = formatter.string(from: now)
          print(datetime)
          return datetime
      }
  
  }
  </code></pre>
  <p>as a result, I can't upload the image to storage</p>
  <hr />
  <p>In this case, I have an error () as shown above. instead of the default image, one of the 6 permanent images that would be in the simulator had to come out.</p>
  <p><a href="https://i.stack.imgur.com/Kvmyu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kvmyu.jpg" alt="the appearance of the problem in the screenshot" /></a></p>