0
필자는 코드에 무엇이 잘못되었으며 firebase이 데이터를 저장하지 않는지 알아 내려고했지만 왜 그럴 수 없습니까. 문제Firebase Firestore 데이터 저장이 작동하지 않습니다. IOS
코드 :
func save() {
let userDict: [String: Any] = ["uid" : uid!, "username" : username!, "fullName" : fullName!, "email" : email!, "age" : age!, "score" : 0]
// Savving to Firestore database
db.collection("users").document(uid!).setData(userDict) { (error:Error?) in
if let error = error {
print("\(error.localizedDescription)")
} else {
print("Document was created")
}
}
// Storing the profile image
let storageRef = storage.reference().child("\(uid!).png")
if let uploadData = UIImagePNGRepresentation(profileImage!) {
storageRef.putData(uploadData, metadata: nil, completion: { (metadeta, error) in
if error != nil {
print(error!)
return
}
})
}
}
이미지가 중포 기지 저장 장치에 저장되어 있지만, 사용자 데이터는 클라우드의 경우 FireStore에 저장되지 않습니다. 이것은 코드를 실행하고 있지만 제대로 작동하지 않는다는 것을 의미합니다. 사람이 왜 이런 일에 대한 통찰력을 줄 수 있다면, 제가 어쩌면 아이 변경 생각