react-native-appmetrica/README.md

27 lines
648 B
Markdown
Raw Permalink Normal View History

2020-06-08 22:14:06 +03:00
# react-native-appmetrica
React Native bridge to the [AppMetrica](https://appmetrica.yandex.com/) on both iOS and Android.
## Installation
2023-08-08 16:26:58 +03:00
1. `npm install @jil/react-native-appmetrica --save`
2020-06-08 22:14:06 +03:00
## Usage
```js
2023-08-08 16:28:59 +03:00
import AppMetrica from '@ijl/react-native-appmetrica';
2020-06-08 22:14:06 +03:00
// Starts the statistics collection process.
2020-12-22 15:03:52 +03:00
AppMetrica.activate({
2020-06-08 22:14:06 +03:00
apiKey: '...KEY...',
sessionTimeout: 120,
2021-12-09 13:56:22 +03:00
firstActivationAsUpdate: false,
2020-06-08 22:14:06 +03:00
});
// 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');
```