I have learned from reading that Firebase officially supports react-native.
https://firebase.googleblog.com/2016/01/the-beginners-guide-to-react-native-and_84.html
I have followed the above link and performed these steps:
npm install firebase --save
index.ios.js
and imported firebase import * as firebase from 'firebase';
const firebaseConfig = {
apiKey: "<your-api-key>",
authDomain: "<your-auth-domain>",
databaseURL: "<your-database-url>",
storageBucket: "<your-storage-bucket>",
,
};
const firebaseApp = firebase.initializeApp(firebaseConfig);
I have put all the right values in the above fields. From my understanding, this should enable Firebase analytics in my project and I should see session reporting in Firebase console. But I can't see anything.
Am I missing anything here? Also is there any way to get Firebase logs in react native so that I can know what's happening?
The Firebase web SDK (including real-time database) works with React Native. However, Firebase does not currently offer analytics as part of the Web SDK. To enable analytics, you would need to implement a wrapper around the native SDKs or use a library such as https://github.com/fullstackreact/react-native-firestack.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With