evollu / evollu/react-native-firebase-analytics

undefined is not an object (evaluating 'FIRAnalytics.setEnabled)

Open
#46 6 comments 5 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
206
Forks
52
PR merge metrics
No merged PRs in 30d

Description

![image](https://cloud.githubusercontent.com/assets/8033320/22617947/00c10196-eb14-11e6-9d3a-9d8fefdbe4d8.png)

using react-native-firbase-analytics `1.0.6`
using react-native `0.32.0`

```javascript
import React, {
Component,
PropTypes,
} from 'react';
import {
View,
StyleSheet,
ScrollView,
Alert,
AlertIOS,
InteractionManager,
} from 'react-native';
import Analytics from 'react-native-firebase-analytics';
import Dialog from 'react-native-dialog';

// ...

export default class CartPage extends Component {
constructor(props) {
super(props);
this.state = {
renderPlaceholderOnly: false,
};
props.dispatch(fetchCartInfo(props.serviceType));
props.dispatch(fetchMyCouponCount());
}

componentWillMount() {
console.log(Analytics.setEnabled);
Analytics.setEnabled(false);
}
```

I trying run this Component. occurring error `undefined is not an object (evaluating 'FIRAnalytics.setEnabled)`

but console is that.
```
02-04 19:52:28.531 2896 2959 I ReactNativeJS: [Function: setEnabled]
02-04 19:52:29.127 2896 2959 E ReactNativeJS: undefined is not an object (evaluating 'FIRAnalytics.setEnabled')
```

Naturally, I included google-service.json file as well. and already run `rnpm link` what the hell?
I think `NativeModules.RNFIRAnalytics` is undefined.
What should I check?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.