Releases: mixpanel/mixpanel-react-native
Release v2.4.1
Release v3.0.0-beta.1
v3.0.0-beta.1 (2024-02-29)
Expo and React Native Web support
This version(PR #223) introduces support for Expo, React Native Web, and any platform using React Native that does not support iOS and Android. To activate this, initialize Mixpanel with an additional parameter useNative
set to false, which will enable JavaScript mode. Currently in beta, we plan to iterate on this to address any issues and add more features. We welcome your feedback.
const trackAutomaticEvents = false;
const useNative = false;
const mixpanel = new Mixpanel(
"YOUR_MIXPANEL_TOKEN",
trackAutomaticEvents,
useNative
);
mixpanel.init();
To try the Expo sample app, navigate to Samples/MixpanelExpo
, run npm install
, and then execute npm run ios
or npm run android
To use it in your existing project, please:
npm install mixpanel-react-native@beta
npm install @react-native-async-storage/async-storage
or
yarn add mixpanel-react-native@beta
yarn add @react-native-async-storage/async-storage
When JavaScript mode is enabled, Mixpanel utilizes AsyncStorage to persist data. If you prefer not to use it, or if AsyncStorage is unavailable in your target environment, you can import or define a different storage class. However, it must follow the same interface as AsyncStorage The following example demonstrates how to use a custom storage solution:
const MyAsyncStorage = require("@my-org/<library-path>/AsyncStorage"); // or your own storage class
const trackAutomaticEvents = false;
const useNative = false;
const mixpanel = new Mixpanel('YOUR_TOKEN', trackAutomaticEvents, useNative, MyAsyncStorage);
mixpanel.init();
Known limitations and differences compared to the native mode (iOS/Android):
- Automatic Events are currently not supported in this mode. Setting 'trackAutomaticEvents' to 'true' will have no effect.
- Certain Mixpanel Properties are unavailable in Javascript mode, including detailed information about the device and screen.
- The default flush interval is set to 10 seconds. The data will not flush automatically when the app moves to the background. We recommend flushing more frequently for key events.
Release v2.4.0
Release v2.3.1
Release v2.3.0
Release v2.2.5
Release v2.2.4
Release v2.2.3
What's Changed
- Update README.md Logo by @austinpray-mixpanel in #182
- safer handling of nil superProperties by @jaredmixpanel in #183
- use ubuntu-latest in github release action by @jaredmixpanel in #184
- Make 'groups' argument optional in trackWithGroups by @m0rl in #169
New Contributors
- @austinpray-mixpanel made their first contribution in #182
- @m0rl made their first contribution in #169
Full Changelog: v2.2.1...v2.2.3
Release v2.2.1
Release v2.2.0
v2.2.0 (2023-03-06)
NOTE:
- From this version we will prefix randomly generated device-specific distinct_ids with "$device:". The prefix is applied the next time a new random ID is generated, any IDs generated by previous SDK versions and persisted on the device will continue to be used as-is until reset is called to generate a new ID. This does not change the value sent for the $device_id property, which will continue to be the randomly-generated ID without a prefix. Mixpanel's $identify endpoint has been updated to accept UUIDs with this prefix to coordinate with this change.
Enhancements
- bump ios to 4.0.5 and android to 7.3.0 #176