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 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 mixpanel = new Mixpanel("Your Project Token");
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 mixpanel = new Mixpanel("Your Project Token");
85
+ const trackAutomaticEvents = true;
86
+ const mixpanel = new Mixpanel("Your Project Token", trackAutomaticEvents);
85
87
  mixpanel.init();
86
88
 
87
89
  const SampleApp = () => {
@@ -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.0", "mp_lib": "react-native"});
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.0", "mp_lib": "react-native", "super": "property"});
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 () => {
@@ -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 Fri Sep 09 2022 15:21:59 GMT-0700 (Pacific Daylight Time)
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>
@@ -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 Fri Sep 09 2022 15:21:59 GMT-0700 (Pacific Daylight Time)
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 Fri Sep 09 2022 15:21:59 GMT-0700 (Pacific Daylight Time)
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 mixpanel = new Mixpanel(&quot;Your Project Token&quot;);
99
+ const trackAutomaticEvents = true;
100
+ const mixpanel = new Mixpanel(&quot;Your Project Token&quot;, 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 &quot;react-native&quot;;
120
121
  import { Mixpanel } from 'mixpanel-react-native';
121
122
 
122
- const mixpanel = new Mixpanel(&quot;Your Project Token&quot;);
123
+ const trackAutomaticEvents = true;
124
+ const mixpanel = new Mixpanel(&quot;Your Project Token&quot;, 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 Fri Sep 09 2022 15:21:59 GMT-0700 (Pacific Daylight Time)
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>
@@ -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 Fri Sep 09 2022 15:21:59 GMT-0700 (Pacific Daylight Time)
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mixpanel-react-native",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Official React Native Tracking Library for Mixpanel Analytics",
5
5
  "main": "index.js",
6
6
  "scripts": {