react-native-appmetrica/example/index.js
Aliaksei Nestsiarovich a5bdc83170 release 2.0.0
2020-06-08 22:14:06 +03:00

25 lines
622 B
JavaScript

/*
* Version for React Native
* © 2020 YANDEX
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://yandex.com/legal/appmetrica_sdk_agreement/
*/
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import AppMetrica from 'react-native-appmetrica';
AppMetrica.activate({
apiKey: ...Your_APIKey...,
});
try {
callingNonExistentVariable;
} catch (e) {
AppMetrica.reportError(e.message, e.stack);
}
AppMetrica.reportEvent('My event');
AppRegistry.registerComponent(appName, () => App);