2
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

posted at

【Swift】FirebaseのdocumentIDを取得する方法

var documentId : String?

self.firestore.collection("users").document("samplesample")
            .getDocuments() { (querySnapshot, err) in
                if let err = err {
                    print("Error getting documents: \(err)")
                } else {
                     for document in querySnapshot!.documents {

                         self.documentId = document.documentID
                     }
                  }
              }

Register as a new user and use Qiita more conveniently

  1. You can follow users and tags
  2. you can stock useful information
  3. You can make editorial suggestions for articles
What you can do with signing up
2
Help us understand the problem. What are the problem?