Mor*_*ren 0 ios firebase swift firebase-realtime-database
我正在尝试使用Swift在空的firebase数据库中创建一个子代,代码运行时没有任何错误,但我没有看到数据库中的更改.代码:
let ref = Database.database().reference()
ref.child("Branches")
Run Code Online (Sandbox Code Playgroud)
您没有向数据库添加值.
在Firebase中,您可以在设置新值后立即创建其他子项.
您可以使用setValue或updateChildValues添加值.
例:
let ref = Database.database().reference().child("branches")
let values = ["any_key" : "any_value"]
ref.updateChildValues(values) { (err, reference) in
// handle errors or anything related to completion block.
}
Run Code Online (Sandbox Code Playgroud)
文档: https ://firebase.google.com/docs/database/ios/read-and-write
注意:请确保您正确配置了所有内容:https://firebase.google.com/docs/database/ios/start
| 归档时间: |
|
| 查看次数: |
364 次 |
| 最近记录: |