我做了一个简单的电话ref.once('value', callback).回调永远不会被调用.
相反,我在Chrome控制台中收到此错误: Refused to display 'https://console.firebase.google.com/project/project6...redacted...73&parent=http%3A%2F%2Flocalhost%3A8204&pfname=&rpctoken=3...redacted...4' in a frame because it set 'X-Frame-Options' to 'DENY'.
我不知道这个iFrame是什么,或者这就是为什么我没有得到回调.FWIW,我正在运行我的开发应用程序localhost:8204
编辑:这是一个更全面的代码示例.
import firebase from 'firebase/app'
import 'firebase/auth'
import 'firebase/database'
firebase.initializeApp({
apiKey: config.firebaseApiKey,
authDomain: `${config.firebaseAppName}.firebaseio.com`,
databaseURL: `https://${config.firebaseAppName}.firebaseio.com`,
storageBucket: config.firebaseStorageBucket
})
const ref = firebase.database().ref()
ref.once('value', callback)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
930 次 |
| 最近记录: |