【发布时间】:2019-05-20 14:44:49
【问题描述】:
下面是我的 App.js 文件的构造函数。
.Auth 函数运行良好.....因为当用户 auth 更改时,函数“onAuthStateChanged”运行。 但是,当我在 firebase 中更新 Profile 集合(手动使用 Web GUI)时,控制台不会记录任何内容。 Profile 集合是我的 FB 数据库中唯一的子集合。 谁能帮我调试一下?谢谢
constructor(props) {
super(props);
//initialize firebase
if (!Firebase.apps.length) {
Firebase.initializeApp(firebaseConfig);
}
Firebase.auth().onAuthStateChanged(this.onAuthStateChanged);
Firebase.database()
.ref('Profile/')
.on('value', (snapshot) => {
console.log(snapshot.val());
});
}
【问题讨论】:
标签: firebase react-native firebase-realtime-database