Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

React Native - iOS app crashes on fetching database from firebase - rnfirebase.io

$
0
0

In the firebase database, I have only one object. And it has only one value.

In android, everything is working fine. In iOS, the app crashes on 'on' method.

Below message appears in the red screen in iOS:

undefined is not a function (this._database.native.on...)

Here is the code that I am using in componentDidMount.

componentDidMount() {        database()            .ref('/checkPlatform')            .on('value', snapshot => {                let firebaseData = snapshot.val()                this.setState({ isAndroidDisable: firebaseData.isPlatformEnabled })            }); }

Instead of the on method, I've also tried once(). But no luck.

Any help will be appreciated.


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>