请帮忙。迁移到新的Firebase后,我无法检索数据。 使用这样的结构:从新的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是的,当然是 –