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.