Can't init Countly in React native

When I use Countly in React Native by code below and get a crash like image.
My code:

import Countly from 'countly-sdk-react-native-bridge';
import { analyticConfig } from '../configs';
import { Device } from '../../../common';
export class AnalyticUtils {
static init = () => {
Countly.init(analyticConfig.url, analyticConfig.apiKey, Device.getDeviceId());
Countly.enableCrashReporting();
};
}


In the code:
const CountlyReactNative = NativeModules.CountlyReactNative;
Countly.init = function(serverUrl,
appKey,.............
){
...............
CountlyReactNative.init(args)
}
I debugged and check reason by "CountlyReactNative" return undefined so it can't call "CountlyReactNative.init(args)"

Version:
"react": "16.9.0",
"react-native": "0.59.10",
"countly-sdk-react-native-bridge": "^19.8.1",

Please help me resolve it. Thanks

0

Comments

3 comments

Please sign in to leave a comment.