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

0.14.1 • Public • Published

react-native-mytracker npm version Downloads

This is unofficial React Native wrapper for myTrackerSDK

Installation

npm install @splicer97/react-native-mytracker

or

yarn add @splicer97/react-native-mytracker

then install pod

cd ios && pod install

Usage

import MyTracker from '@splicer97/react-native-mytracker';

// ...

MyTracker.initTracker('SDK_KEY');

//MyTracker Parameters
MyTracker.setCustomUserId('USER_ID');

//MyTracker Configurations
MyTracker.trackLaunchEnable(true);

MyTracker.autotrackPurchase(true);

MyTracker.trackLaunchTimeout(30);

MyTracker.bufferingPeriod(30);

MyTracker.forcingPeriod(30);

//for IOS:
// 0 = MRLocationTrackingModeNone — location is not tracked
// 1 = MRLocationTrackingModeCached — uses the system's cached value
// 2 = MRLocationTrackingModeActive — uses a request for the current location (default)
// for Android:
// 0 = false - do not track the user's location (default)
// 1 or 2 = true - track the user's location
MyTracker.trackLocation(0);

MyTracker.setDebugMode(false);

//MyTracker Events
MyTracker.trackEvent('name');

MyTracker.trackEventWithParams('name', {
  param1: 'name1',
  param2: 'name2',
});

MyTracker.trackLoginEvent('userId', 'vkConnectId');

MyTracker.trackLoginEventWithParams('userId', 'vkConnectId', {
  param1: 'name1',
  param2: 'name2',
});

MyTracker.trackInviteEvent();

MyTracker.trackInviteEventWithParams({
  param1: 'name1',
  param2: 'name2',
});

MyTracker.flush();

MyTracker.trackRegistrationEvent('userId', 'vkConnectId');

MyTracker.trackRegistrationEventWithParams('userId', 'vkConnectId', {
  param1: 'name1',
  param2: 'name2',
});

MyTracker.trackLevel();

MyTracker.trackLevelWithLevel(1);

MyTracker.trackLevelWithLevelWithParams(1, {
  param1: 'name1',
  param2: 'name2',
});

const instanceId = await MyTracker.getInstanceId();

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Package Sidebar

Install

npm i @splicer97/react-native-mytracker

Weekly Downloads

103

Version

0.14.1

License

MIT

Unpacked Size

62.3 kB

Total Files

23

Last publish

Collaborators

  • splicer97