Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Expo support #223

Merged
merged 8 commits into from Feb 29, 2024
Merged

Add Expo support #223

merged 8 commits into from Feb 29, 2024

Conversation

zihejia
Copy link
Collaborator

@zihejia zihejia commented Feb 27, 2024

This PR introduces support for Expo, React Native Web, and any platform using React Native that does not support iOS and Android. To activate this feature, initialize Mixpanel with an additional parameter useNative set to false. This will enable Javascript mode.

 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

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.

@zihejia zihejia merged commit 8c9055b into master Feb 29, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant