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

2.7.0 • Public • Published

@gennadysx/react-native-appmetrica

React Native bridge to the AppMetrica on both iOS and Android.
This package forked from RNAppMetrica for modification to newer rn versions.

What's new here:

  • Upgraded SDK versions to (IOS: v4.5.2, Android: v5.3.0)
  • Support for Apple Silicon chips
  • Support for TypeScript
  • Supports only above v0.63.4

Installation

  1. npm install @gennadysx/react-native-appmetrica --save
  2. If React Native version <= 0.63.4:
    react-native link @gennadysx/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

Usage

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

Origin Yandex AppMetrica. Modified with by GennadySX @2022.

Package Sidebar

Install

npm i @gennadysx/react-native-appmetrica

Weekly Downloads

140

Version

2.7.0

License

MIT

Unpacked Size

633 kB

Total Files

84

Last publish

Collaborators

  • gennadysx