mixpanel-react-native 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +4 -2
- package/__tests__/index.test.js +2 -2
- package/docs/Mixpanel.html +1 -1
- package/docs/MixpanelGroup.html +1 -1
- package/docs/People.html +1 -1
- package/docs/index.html +5 -3
- package/docs/index.js.html +1 -1
- package/index.d.ts +2 -2
- package/ios/MixpanelReactNative.m +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
#
|
|
2
2
|
|
|
3
|
+
## [v2.0.1](https://github.com/mixpanel/mixpanel-react-native/tree/v2.0.1) (2022-09-12)
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- update typescript and iOS bridging header [\#158](https://github.com/mixpanel/mixpanel-react-native/pull/158)
|
|
8
|
+
|
|
9
|
+
#
|
|
10
|
+
|
|
3
11
|
## [v2.0.0](https://github.com/mixpanel/mixpanel-react-native/tree/v2.0.0) (2022-09-09)
|
|
4
12
|
|
|
13
|
+
### BREAKING CHANGE:
|
|
14
|
+
This major release removes all remaining calls to Mixpanel's `/decide` API endpoint. The main effect of this is that the SDK no longer fetches the remote status of your [project's "Automatically collect common mobile events" setting](https://help.mixpanel.com/hc/en-us/articles/115004596186#enable-or-disable-common-mobile-events). From this version forward, automatic event tracking can only be controlled by the, now required, parameter `trackAutomaticEvents`. Upon upgrading, existing implementations will need to add this parameter to their Mixpanel initializer calls.
|
|
15
|
+
|
|
5
16
|
### Enhancements
|
|
6
17
|
|
|
7
18
|
- make trackAutomaticEvents required and bump versions to deprecate Decide [\#153](https://github.com/mixpanel/mixpanel-react-native/pull/153)
|
|
@@ -226,5 +237,7 @@ Report issues or give us any feedback is appreciated!
|
|
|
226
237
|
|
|
227
238
|
|
|
228
239
|
|
|
240
|
+
|
|
241
|
+
|
|
229
242
|
|
|
230
243
|
|
package/README.md
CHANGED
|
@@ -55,7 +55,8 @@ To start tracking with the library you must first initialize with your project t
|
|
|
55
55
|
```js
|
|
56
56
|
import { Mixpanel } from 'mixpanel-react-native';
|
|
57
57
|
|
|
58
|
-
const
|
|
58
|
+
const trackAutomaticEvents = true;
|
|
59
|
+
const mixpanel = new Mixpanel("Your Project Token", trackAutomaticEvents);
|
|
59
60
|
mixpanel.init();
|
|
60
61
|
|
|
61
62
|
```
|
|
@@ -81,7 +82,8 @@ import React from 'react';
|
|
|
81
82
|
import { Button, SafeAreaView } from "react-native";
|
|
82
83
|
import { Mixpanel } from 'mixpanel-react-native';
|
|
83
84
|
|
|
84
|
-
const
|
|
85
|
+
const trackAutomaticEvents = true;
|
|
86
|
+
const mixpanel = new Mixpanel("Your Project Token", trackAutomaticEvents);
|
|
85
87
|
mixpanel.init();
|
|
86
88
|
|
|
87
89
|
const SampleApp = () => {
|
package/__tests__/index.test.js
CHANGED
|
@@ -9,13 +9,13 @@ import { NativeModules } from 'react-native';
|
|
|
9
9
|
|
|
10
10
|
test(`it calls MixpanelReactNative initialize`, async () => {
|
|
11
11
|
const mixpanel = await Mixpanel.init("token", true);
|
|
12
|
-
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, false, {"$lib_version": "2.0.
|
|
12
|
+
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, false, {"$lib_version": "2.0.1", "mp_lib": "react-native"});
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
test(`it calls MixpanelReactNative initialize with optOut and superProperties`, async () => {
|
|
16
16
|
const mixpanel = new Mixpanel("token", true);
|
|
17
17
|
mixpanel.init(true, {"super": "property"})
|
|
18
|
-
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, true, {"$lib_version": "2.0.
|
|
18
|
+
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, true, {"$lib_version": "2.0.1", "mp_lib": "react-native", "super": "property"});
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
test(`it calls MixpanelReactNative setServerURL`, async () => {
|
package/docs/Mixpanel.html
CHANGED
|
@@ -4316,7 +4316,7 @@ To clear all superProperties, use clearSuperProperties()
|
|
|
4316
4316
|
<br class="clear">
|
|
4317
4317
|
|
|
4318
4318
|
<footer>
|
|
4319
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on
|
|
4319
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Mon Sep 12 2022 12:35:41 GMT-0700 (Pacific Daylight Time)
|
|
4320
4320
|
</footer>
|
|
4321
4321
|
|
|
4322
4322
|
<script> prettyPrint(); </script>
|
package/docs/MixpanelGroup.html
CHANGED
|
@@ -957,7 +957,7 @@ If the property exists and is not list-valued, the union will be ignored.
|
|
|
957
957
|
<br class="clear">
|
|
958
958
|
|
|
959
959
|
<footer>
|
|
960
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on
|
|
960
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Mon Sep 12 2022 12:35:41 GMT-0700 (Pacific Daylight Time)
|
|
961
961
|
</footer>
|
|
962
962
|
|
|
963
963
|
<script> prettyPrint(); </script>
|
package/docs/People.html
CHANGED
|
@@ -1625,7 +1625,7 @@ If the property exists and is not list-valued, the union will be ignored.
|
|
|
1625
1625
|
<br class="clear">
|
|
1626
1626
|
|
|
1627
1627
|
<footer>
|
|
1628
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on
|
|
1628
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Mon Sep 12 2022 12:35:41 GMT-0700 (Pacific Daylight Time)
|
|
1629
1629
|
</footer>
|
|
1630
1630
|
|
|
1631
1631
|
<script> prettyPrint(); </script>
|
package/docs/index.html
CHANGED
|
@@ -96,7 +96,8 @@ We'd also love for you to come and work with us! Check out <strong><a href="http
|
|
|
96
96
|
<p>To start tracking with the library you must first initialize with your project token. You can get your project token from <a href="https://mixpanel.com/settings/project">project settings</a>.</p>
|
|
97
97
|
<pre class="prettyprint source lang-js"><code>import { Mixpanel } from 'mixpanel-react-native';
|
|
98
98
|
|
|
99
|
-
const
|
|
99
|
+
const trackAutomaticEvents = true;
|
|
100
|
+
const mixpanel = new Mixpanel("Your Project Token", trackAutomaticEvents);
|
|
100
101
|
mixpanel.init();
|
|
101
102
|
|
|
102
103
|
</code></pre>
|
|
@@ -119,7 +120,8 @@ import React from 'react';
|
|
|
119
120
|
import { Button, SafeAreaView } from "react-native";
|
|
120
121
|
import { Mixpanel } from 'mixpanel-react-native';
|
|
121
122
|
|
|
122
|
-
const
|
|
123
|
+
const trackAutomaticEvents = true;
|
|
124
|
+
const mixpanel = new Mixpanel("Your Project Token", trackAutomaticEvents);
|
|
123
125
|
mixpanel.init();
|
|
124
126
|
|
|
125
127
|
const SampleApp = () => {
|
|
@@ -176,7 +178,7 @@ Please refer to our <a href="https://mixpanel.com/legal/app-store-privacy-detai
|
|
|
176
178
|
<br class="clear">
|
|
177
179
|
|
|
178
180
|
<footer>
|
|
179
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on
|
|
181
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Mon Sep 12 2022 12:35:41 GMT-0700 (Pacific Daylight Time)
|
|
180
182
|
</footer>
|
|
181
183
|
|
|
182
184
|
<script> prettyPrint(); </script>
|
package/docs/index.js.html
CHANGED
|
@@ -927,7 +927,7 @@ class ObjectHelper {
|
|
|
927
927
|
<br class="clear">
|
|
928
928
|
|
|
929
929
|
<footer>
|
|
930
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on
|
|
930
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Mon Sep 12 2022 12:35:41 GMT-0700 (Pacific Daylight Time)
|
|
931
931
|
</footer>
|
|
932
932
|
|
|
933
933
|
<script> prettyPrint(); </script>
|
package/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ type MixpanelType = any;
|
|
|
2
2
|
type MixpanelProperties = { [key: string]: MixpanelType };
|
|
3
3
|
|
|
4
4
|
export class Mixpanel {
|
|
5
|
-
constructor(token: string);
|
|
6
|
-
static init(token: string, optOutTrackingDefault?: boolean): Promise<Mixpanel>;
|
|
5
|
+
constructor(token: string, trackAutomaticEvents: boolean);
|
|
6
|
+
static init(token: string, trackAutomaticEvents: boolean, optOutTrackingDefault?: boolean): Promise<Mixpanel>;
|
|
7
7
|
init(optOutTrackingDefault?: boolean, superProperties?: MixpanelProperties): Promise<void>;
|
|
8
8
|
setServerURL(serverURL: string): void;
|
|
9
9
|
setLoggingEnabled(loggingEnabled: boolean): void;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
// MARK: - Mixpanel Instance
|
|
7
7
|
|
|
8
|
-
RCT_EXTERN_METHOD(initialize:(NSString *)token optOutTrackingByDefault:(BOOL)optOutTrackingByDefault properties:(NSDictionary *)properties resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
|
8
|
+
RCT_EXTERN_METHOD(initialize:(NSString *)token trackAutomaticEvents:(BOOL)trackAutomaticEvents optOutTrackingByDefault:(BOOL)optOutTrackingByDefault properties:(NSDictionary *)properties resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
|
9
9
|
|
|
10
10
|
// Mark: - Settings
|
|
11
11
|
RCT_EXTERN_METHOD(setServerURL:(NSString *)token serverURL:(NSString *)serverURL resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|