使用 React Native 与 Firebase 一起使用
Firebase React Native App
With the new 3.1.0 SDK, Firebase Database and Firebase Auth, now work with React Native.
Rather than use new Firebase(url) like with the old SDK, you now configure firebase with firebase.initializeApp(config),
and use the new firebase.database().ref() method.
const React = require("react-native");
const firebase = require("firebase");
// Initialize Firebase
const firebaseConfig = {
apiKey: "",
authDomain: "",
databaseURL: "",
storageBucket: "",
};
firebase.initializeApp(firebaseConfig);
// Create a reference with .ref() instead of new Firebase(url)
const rootRef = firebase.database().ref();
const itemsRef = rootRef.child('items');
暂无开放 Issues,或尚未同步最近议题。