the documentid wrapper is not working properly

The id of the UserProfile struct and the id of your data in Firestore are separate. That’s why you’re seeing the random string of letters.

I would change your struct similar to the below and you can just ignore the regular “id” variable when you initialize and refer to the documentID instead.

struct UserProfile : Codable, Identifiable {
    var id = UUID() // ID for the struct
    var documentID: String // ID for the post in Database

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top