mixpanel-react-native
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -12,3 +12,3 @@ /** | ||
const mixpanel = await Mixpanel.init("token", true); | ||
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, false, {"$lib_version": "2.0.1", "mp_lib": "react-native"}); | ||
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, false, {"$lib_version": "2.1.0", "mp_lib": "react-native"}); | ||
}); | ||
@@ -19,3 +19,3 @@ | ||
mixpanel.init(true, {"super": "property"}) | ||
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, true, {"$lib_version": "2.0.1", "mp_lib": "react-native", "super": "property"}); | ||
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, true, {"$lib_version": "2.1.0", "mp_lib": "react-native", "super": "property"}, "https://api.mixpanel.com"); | ||
}); | ||
@@ -22,0 +22,0 @@ |
# | ||
## [v2.1.0](https://github.com/mixpanel/mixpanel-react-native/tree/v2.1.0) (2022-09-14) | ||
### Enhancements | ||
- add serverURL to init params and fix Android module [\#160](https://github.com/mixpanel/mixpanel-react-native/pull/160) | ||
# | ||
## [v2.0.1](https://github.com/mixpanel/mixpanel-react-native/tree/v2.0.1) (2022-09-12) | ||
@@ -244,1 +252,3 @@ | ||
@@ -7,3 +7,3 @@ type MixpanelType = any; | ||
static init(token: string, trackAutomaticEvents: boolean, optOutTrackingDefault?: boolean): Promise<Mixpanel>; | ||
init(optOutTrackingDefault?: boolean, superProperties?: MixpanelProperties): Promise<void>; | ||
init(optOutTrackingDefault?: boolean, superProperties?: MixpanelProperties, serverURL?: String): Promise<void>; | ||
setServerURL(serverURL: string): void; | ||
@@ -10,0 +10,0 @@ setLoggingEnabled(loggingEnabled: boolean): void; |
@@ -64,5 +64,5 @@ "use strict"; | ||
*/ | ||
async init(optOutTrackingDefault = DEFAULT_OPT_OUT, superProperties = {}) { | ||
async init(optOutTrackingDefault = DEFAULT_OPT_OUT, superProperties = {}, serverURL = "https://api.mixpanel.com") { | ||
let metadata = Helper.getMetaData(); | ||
await MixpanelReactNative.initialize(this.token, this.trackAutomaticEvents, optOutTrackingDefault, {...metadata, ...superProperties}); | ||
await MixpanelReactNative.initialize(this.token, this.trackAutomaticEvents, optOutTrackingDefault, {...metadata, ...superProperties}, serverURL); | ||
} | ||
@@ -74,3 +74,4 @@ | ||
* <pre><code> | ||
* const mixpanel = new Mixpanel('your project token'); | ||
* const trackAutomaticEvents = true; | ||
* const mixpanel = new Mixpanel('your project token', trackAutomaticEvents); | ||
* mixpanel.init(); | ||
@@ -77,0 +78,0 @@ * </code></pre> |
{ | ||
"name": "mixpanel-react-native", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Official React Native Tracking Library for Mixpanel Analytics", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2729
2071748