【发布时间】:2016-09-15 22:02:01
【问题描述】:
请帮忙。迁移到新的 Firebase 后,我无法检索数据。 使用这个结构:
let ref = FIRDatabase.database().reference()
override func viewDidLoad() {
super.viewDidLoad()
ref.observeEventType(FIRDataEventType.Value, withBlock: { (snapshot) in
let postDict = snapshot.value as! [String : AnyObject]
print("\(postDict)")
})
}
运行后我看到错误:
2016-05-19 10:04:22.264 123a[88652:13688922] The default app has not been configured yet.
2016-05-19 10:04:22.276 123a[88652:13688922] *** Terminating app due to uncaught exception 'MissingDatabaseURL', reason: 'Failed to get FIRDatabase instance: FIRApp object has no databaseURL in its FirebaseOptions object.'
*** First throw call stack:
我阅读了文档,但无法解决此问题。 GoogleService-Info.plist 我添加到项目中。
【问题讨论】:
-
你之前用过 FIRApp.configure() 吗?
-
@GabrieleMariotti 是的,当然