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 support to use custom storage instead of @react-native-async-storage/async-storage(3.0.0-beta2) #225

Merged
merged 19 commits into from Mar 6, 2024

Conversation

zihejia
Copy link
Collaborator

@zihejia zihejia commented Mar 5, 2024

  • Add support to use custom storage instead of @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();
  • Make optOutTracking and optInTracking consistent with the native SDK.

@zihejia zihejia added the enhancement New feature or request label Mar 6, 2024
@zihejia zihejia changed the title 3.0.0.beta-2 Add support to use custom storage instead of @react-native-async-storage/async-storage(3.0.0-beta2) Mar 6, 2024
@zihejia zihejia merged commit b8f6c7d into master Mar 6, 2024
2 of 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