請幫忙。遷移到新的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是的,當然是 –