Go to file
2017-09-30 15:41:58 +03:00
android Add support for Android 2017-09-23 22:37:31 +03:00
example Working iOS example 2017-09-30 15:40:54 +03:00
ios/RCTAppMetrica reportError method 2017-09-28 13:01:38 +02:00
.eslintignore Add ESLint 2017-09-18 10:07:46 +03:00
.eslintrc.json Add flow annotation 2017-09-30 15:41:58 +03:00
.flowconfig Add flow annotation 2017-09-30 15:41:58 +03:00
.gitignore gitignore 2017-09-18 10:03:45 +03:00
.npmignore Add example project to npmignore 2017-09-30 14:29:12 +03:00
.travis.yml Enable travis 2017-09-18 10:10:51 +03:00
index.js Add flow annotation 2017-09-30 15:41:58 +03:00
LICENSE Initial commit 2017-09-18 09:46:10 +03:00
package-lock.json 0.0.2 2017-09-23 13:20:05 +03:00
package.json Add flow annotation 2017-09-30 15:41:58 +03:00
README.md Update README 2017-09-30 15:41:17 +03:00
yarn.lock yarn 2017-09-30 15:41:24 +03:00

Build Status NPM version

react-native-appmetrica

React Native bridge to the AppMetrica on both iOS and Android.

NOTE: Only iOS support for now. Feel free to send PR with Android support.

Installation

  1. Setup AppMetrica. YandexMobileMetrica.framework should be placed at <project_dir>/ios/ or <project_dir>/ios/Frameworks/. Otherwise you'll get build error.
  2. npm install --save react-native-appmetrica
  3. react-native link react-native-appmetrica

iOS notice: If you build failed after installing SDK and react-native-appmetrica make sure YandexMobileMetrica.framework and libRCTAppMetrica.a are included at Build Phase -> Link Binary With Libraries

Example

import AppMetrica from 'react-native-appmetrica';

AppMetrica.activateWithApiKey('2dee16d2-1143-4cd3-a904-39ce10ac2755');

AppMetrica.reportEvent('Hello world')

Usage

import AppMetrica from 'react-native-appmetrica';

// Starts the statistics collection process.
AppMetrica.activateWithApiKey('...KEY...');

// Sends a custom event message and additional parameters (optional).
AppMetrica.reportEvent('My event');
AppMetrica.reportEvent('My event', { foo: 'bar' });