@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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.14.153latest

Version History

VersionDownloads (Last 7 Days)Published
0.14.153
0.14.00
0.11.10
0.11.01
0.10.00
0.9.00
0.8.038
0.7.27
0.7.10
0.7.00
0.6.20
0.6.10
0.6.00
0.5.10
0.5.00
0.4.10
0.4.00
0.3.60
0.3.50
0.3.40
0.3.30
0.3.21
0.3.10
0.3.00
0.2.110
0.2.100
0.2.90
0.2.80
0.2.70
0.2.60
0.2.50
0.2.40
0.2.30
0.2.20
0.2.10
0.2.00
0.1.100
0.1.91
0.1.81
0.1.71
0.1.60
0.1.50
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00

Package Sidebar

Install

npm i @splicer97/react-native-mytracker

Weekly Downloads

82

Version

0.14.1

License

MIT

Unpacked Size

62.3 kB

Total Files

23

Last publish

Collaborators

  • splicer97