Closed kingdavidmartins closed 5 months ago
hi @kingdavidmartins , sorry about the convenience, the issue has been fixed in 3.0.2. I'm closing this one now, feel free to reopen if the problem still exists.
Why i have this error if i use useNative = true?
new Mixpanel(MIXPANEL_TOKEN, true, true)
@alexrequelme , This might mean your native environment is not being properly configured for Mixpanel so it falls back to Javascript mode. Have you seen this warning? "MixpanelReactNative is not available; using JavaScript mode. If you prefer not to use the JavaScript mode, please follow the guide in the GitHub repository: https://github.com/mixpanel/mixpanel-react-native." If you share more information regarding which platform you are testing and steps to reproduce this, that would be great.
Mmm, I'm using expo development build, but all works fine on version 2.4.1, when i upgraded i face this issue.
@alexrequelme , if you run npm install @react-native-async-storage/async-storage
will it make the error go away?
I don't use AsyncStorage, I reverted the package back to version 2.4.1 and it's functioning perfectly, so I'll be sticking with this version for the time being.
Keep getting the following
even when
useNative
is set to true.When
useNative
is set to false and I pass custom storage class. It also registers as undefined/null leading it to fallback to async storage which I do not have installed causing the error to be thrownI made sure to make class resemble
mixpanel-storage.js
https://github.com/mixpanel/mixpanel-react-native/blob/a68a0280f489bd8fb1160da4bb9fa938302ceb1d/javascript/mixpanel-storage.js#L3-L36and passed it in like so using Expo Secure Storage. Which also failed
Had to create a patch where I replaced https://github.com/mixpanel/mixpanel-react-native/blob/a68a0280f489bd8fb1160da4bb9fa938302ceb1d/javascript/mixpanel-storage.js#L6
with imports for expo secure storage as well as updating respective apis to custom class I created to begin with which worked.
Patch was needed to use custom storage or to set useNative to
True
. I couldn't use native sdk without 1st resolving async storage issue.Assuming if I installed async storage I wouldn't have had this issue. But if we pass custom storage class shouldn't still be required. Shouldn't also be a blocker for useNative true
Please resolve