@appomart/react-native-appmetrica
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@appomart/react-native-appmetrica

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

About package

This is a temporary solution. This repository includes pull requests from the main repository and will be supported until all critical updates are included. Added updates:

  1. Typescript support
  2. Fix android build
  3. EAS build support

Installation

 yarn add @appomart/react-native-appmetrica

Integration into a pure React Native project

  1. npm install @appomart/react-native-appmetrica --save
  2. If React Native version <= 0.59:
    react-native link @appomart/react-native-appmetrica
  3. iOS only
  • if ${PROJECT_DIR}/ios/Podfile exists:
    npx pod-install
  • if ${PROJECT_DIR}/ios/Podfile don't exists:
    Setup AppMetrica and placed frameworks at ${PROJECT_DIR}/ios/Frameworks

Integrate into an Expo managed project

  1. Install expo-dev-client:
npx expo install expo-dev-client
  1. Add @appomart/react-native-appmetrica into the plugins array inside the app.json file of your app:
"plugins": [
  ["@appomart/react-native-appmetrica", {}],
],

Usage

import AppMetrica from '@appomart/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');

Package Sidebar

Install

npm i @appomart/react-native-appmetrica

Weekly Downloads

34

Version

1.0.0

License

MIT

Unpacked Size

43.1 kB

Total Files

21

Last publish

Collaborators

  • whidrubeld