0.6.0 • Published 3 years ago
react-native-appmetrica-yandex v0.6.0
react-native-appmetrica-yandex
Install
yarn add react-native-appmetrica-yandex- IOS - RN<0.60: - react-native link react-native-appmetrica-yandex- With CocoaPods, add the following line to your - Podfile:- pod 'react-native-appmetrica-yandex', :path => '../node_modules/react-native-appmetrica-yandex' pod 'YandexMobileMetrica', '3.8.2'- Then run - pod install.- RN>=0.60: With React Native 0.60 and later, linking of pods is done automatically - cd ios pod install
- Android - RN<0.60: - 2.1. Open up - android/app/src/main/java/[...]/MainApplication.java- Add import com.codeard.yandexmetrica.YandexAppmetricaPackage;to the imports at the top of the file
- Add - new YandexAppmetricaPackage()to the list returned by the- getPackages()method
 - 2.2. Append the following lines to - android/settings.gradle:- include ':react-native-appmetrica-yandex' project(':react-native-appmetrica-yandex').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-appmetrica-yandex/android') ``` 2.3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: ``` implementation project(':react-native-appmetrica-yandex') ``` **RN>=0.60**: With React Native 0.60 and later, linking is done automatically
- Add 
Usage
import { YandexMetrica } from 'react-native-appmetrica-yandex';
// Initialize
YandexMetrica.activateWithApiKey('KEY');
// OR
YandexMetrica.activateWithConfig({
  apiKey: 'KEY',
  sessionTimeout: 120,
  firstActivationAsUpdate: true,
});
YandexMetrica.setUserProfileID('12345');
YandexMetrica.setUserProfileAttributes({ ... })
// Sends a custom event message and additional parameters (optional).
YandexMetrica.reportEvent('My event');
YandexMetrica.reportEvent('My event', 'Test');
YandexMetrica.reportEvent('My event', { foo: 'bar' });
// Send a custom error event and additional parameters (optional).
YandexMetrica.reportError('My error');
YandexMetrica.reportError('My error', 'Test');
YandexMetrica.reportError('My error', { foo: 'bar' });
YandexMetrica.reportError('My error', new Error('test'));0.6.0
3 years ago
0.5.0
5 years ago
0.4.4
5 years ago
0.4.3
5 years ago
0.4.1
6 years ago
0.4.0
6 years ago
0.3.0
6 years ago
0.2.0
6 years ago
0.1.6
6 years ago
0.1.5
6 years ago
0.1.4
6 years ago
0.1.3
6 years ago
0.1.2
6 years ago
0.1.1
6 years ago
0.0.12
6 years ago
0.0.11
6 years ago
0.0.10
6 years ago
0.0.9
6 years ago
0.0.8
6 years ago
0.0.7
6 years ago
0.0.6
6 years ago
0.0.4
6 years ago
0.0.3
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago