Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

projetoeureka/react-native-mixpanel-bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-mixpanel-bridge

React Native bridge to the Mixpanel libraries on both iOS and Android.

This is inspired by https://github.com/davodesign84/react-native-mixpanel but includes the Mixpanel iOS SDK so you don't need aditional installation steps.

Important: this was only tested with React Native 0.36.0. It's known it doesn't work with versions >= 0.40.0 due to changes on location of React Native headers.

Installation

Install the module: npm install --save react-native-mixpanel-bridge

Link to your project: react-native link react-native-mixpanel-bridge

Usage

import Mixpanel from 'react-native-mixpanel-bridge';

Mixpanel.sharedWithInstanceToken('YOUR_PROJECT_TOKEN');

// track something
Mixpanel.track('Event');
Mixpanel.trackWithProperties('Event', { propertiesObject });
Mixpanel.registerSuperProperties({ superProperties });
Mixpanel.registerSuperPropertiesOnce({ superProperties });
Mixpanel.increment('Event', 1);

// Identify user
Mixpanel.identify('USER_ID');
Mixpanel.set({ userProperties });
Mixpanel.setOnce({ userProperties });

// Timing events
Mixpanel.timeEvent('Event'); // start
Mixpanel.track('Event'); // end

See the Mixpanel reference (for iOS) for more information.

Thanks

Thanks to @davodesign84 for the bridge code.

Releases

No releases published

Packages

No packages published