mixpanel-react-native
Advanced tools
Comparing version 2.3.1 to 2.4.0
@@ -12,3 +12,3 @@ /** | ||
const mixpanel = await Mixpanel.init("token", true); | ||
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, false, {"$lib_version": "2.3.1", "mp_lib": "react-native"}, "https://api.mixpanel.com"); | ||
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, false, {"$lib_version": "2.4.0", "mp_lib": "react-native"}, "https://api.mixpanel.com"); | ||
}); | ||
@@ -19,3 +19,3 @@ | ||
mixpanel.init(true, {"super": "property"}) | ||
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, true, {"$lib_version": "2.3.1", "mp_lib": "react-native", "super": "property"}, "https://api.mixpanel.com"); | ||
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, true, {"$lib_version": "2.4.0", "mp_lib": "react-native", "super": "property"}, "https://api.mixpanel.com"); | ||
}); | ||
@@ -41,2 +41,8 @@ | ||
test(`it calls MixpanelReactNative setFlushBatchSize`, async () => { | ||
const mixpanel = await Mixpanel.init("token", true); | ||
mixpanel.setFlushBatchSize(20); | ||
expect(NativeModules.MixpanelReactNative.setFlushBatchSize).toBeCalledWith("token", 20); | ||
}); | ||
test(`it calls MixpanelReactNative hasOptedOutTracking`, async () => { | ||
@@ -43,0 +49,0 @@ const mixpanel = await Mixpanel.init("token", true); |
@@ -25,2 +25,3 @@ import * as ReactNative from 'react-native'; | ||
setUseIpAddressForGeolocation: jest.fn(), | ||
setFlushBatchSize: jest.fn(), | ||
hasOptedOutTracking: jest.fn(), | ||
@@ -27,0 +28,0 @@ optInTracking: jest.fn(), |
# | ||
## [v2.4.0](https://github.com/mixpanel/mixpanel-react-native/tree/v2.4.0) (2023-12-02) | ||
### Enhancements | ||
- add api: setFlushBatchSize [\#219](https://github.com/mixpanel/mixpanel-react-native/pull/219) | ||
- RN 73 support for Android with AGP 8 required [\#215](https://github.com/mixpanel/mixpanel-react-native/pull/215) | ||
# | ||
## [v2.3.1](https://github.com/mixpanel/mixpanel-react-native/tree/v2.3.1) (2023-06-20) | ||
### Fixes | ||
- fix typo in the identify function resolve [\#205](https://github.com/mixpanel/mixpanel-react-native/pull/205) | ||
# | ||
## [v2.3.0](https://github.com/mixpanel/mixpanel-react-native/tree/v2.3.0) (2023-06-16) | ||
@@ -329,1 +346,5 @@ | ||
@@ -11,4 +11,4 @@ type MixpanelType = any; | ||
setFlushOnBackground(flushOnBackground: boolean): void; | ||
setUseIpAddressForGeolocation(useIpAddressForGeolocation: boolean): void; | ||
setFlushBatchSize(flushBatchSize: number): void; | ||
hasOptedOutTracking(): Promise<boolean>; | ||
@@ -15,0 +15,0 @@ optInTracking(): void; |
13
index.js
@@ -143,3 +143,16 @@ "use strict"; | ||
} | ||
/** | ||
* Set the number of events sent in a single network request to the Mixpanel server. | ||
* By configuring this value, you can optimize network usage and manage the frequency of communication between the client and the server. The maximum size is 50; any value over 50 will default to 50. | ||
* | ||
* @param {integer} flushBatchSize whether to automatically send the client IP Address. | ||
* Defaults to true. | ||
* | ||
*/ | ||
setFlushBatchSize(flushBatchSize) { | ||
MixpanelReactNative.setFlushBatchSize(this.token, flushBatchSize); | ||
} | ||
/** | ||
@@ -146,0 +159,0 @@ * Will return true if the user has opted out from tracking. |
{ | ||
"name": "mixpanel-react-native", | ||
"version": "2.3.1", | ||
"version": "2.4.0", | ||
"description": "Official React Native Tracking Library for Mixpanel Analytics", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -15,8 +15,2 @@ import React from 'react'; | ||
mixpanelInstance.init(); | ||
mixpanelInstance.identify('Unique User ID').then(() => { | ||
mixpanelInstance.getDistinctId().then(distinctId => { | ||
console.log(`DistinctId is ${ distinctId }`); | ||
}); | ||
}); | ||
setMixpanel(mixpanelInstance); | ||
@@ -23,0 +17,0 @@ }, []); |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 7 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2216083
308
2759
22