[英]How to push data to firebase storage from UITextField
I was wondering how to get UITextField
strings to push to the firebase storage.我想知道如何将
UITextField
字符串推送到 firebase 存储。 I am creating a signup page for an app and can't get it to work 100%.我正在为一个应用程序创建一个注册页面,但无法使其 100% 正常运行。 Its pushing data to realtime database but not to storage.
它将数据推送到实时数据库而不是存储。
@IBAction func SignUpButton2(_ sender: Any) {
Auth.auth().createUser(withEmail: EmailAuthProviderID, password: EmailPasswordAuthSignInMethod) { (user, error) in
let db = Firestore.firestore()
db.collection("users").document("Profiles").setData([
"email": self.emailTextField,
"name": self.usernameTextField,
"password": self.passwordTextField
]) { err in
if let err = err {
print("Error writing document: \(err)")
} else {
print("Document successfully written!")
}
}
}
I will assume that your doing this for a tutorial or learning purposes but it's very bad to send the password like this on plain text without encrypting it我会假设你这样做是为了教程或学习目的,但在不加密的情况下以纯文本形式发送密码是非常糟糕的
however you should pass self.emailTextField.text
not self.emailTextField
or EmailAuthProviderID
& EmailPasswordAuthSignInMethod
但是你应该传递
self.emailTextField.text
而不是self.emailTextField
或EmailAuthProviderID
& EmailPasswordAuthSignInMethod
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.