How can I use gameanalytics library in react native?

167 Views Asked by At

I need to use gameanalytics library in my react-native project. I tried to use JS SDK by using npm install and importing, but it works only in debugging mode. when I deactivate debugging mode it gives me error, "getBrowserVersionString" undifined in not an object.

here is my code :

import gameanalytics from 'gameanalytics';

export default class App extends Component<Props> {

_runAnalytic = () => {
    gameanalytics.GameAnalytics.setEnabledInfoLog(true);
    gameanalytics.GameAnalytics.setEnabledVerboseLog(true);
    gameanalytics.GameAnalytics.initialize("xxx", "xxx");
   }


  componentDidMount(){
    this._runAnalytic()
   }

render() {

return (
  <View></View>
)

}
1

There are 1 best solutions below

2
Antoc On

I work for GameAnalytics and have forwarded this to the JS SDK developers. I will be posting the solution here as soon as possible.