React Native bridge to the AppMetrica on both iOS and Android.
npm install react-native-appmetrica --save
react-native link react-native-appmetrica
${PROJECT_DIR}/ios/Podfile
exists: \
npx pod-install
${PROJECT_DIR}/ios/Podfile
don't exists: \
Setup AppMetrica and placed frameworks at ${PROJECT_DIR}/ios/Frameworks
import AppMetrica from 'react-native-appmetrica';
// Starts the statistics collection process.
AppMetrica.activate({
apiKey: '...KEY...',
sessionTimeout: 120,
firstActivationAsUpdate: false,
});
// Sends a custom event message and additional parameters (optional).
AppMetrica.reportEvent('My event');
AppMetrica.reportEvent('My event', { foo: 'bar' });
// Send a custom error event.
AppMetrica.reportError('My error');