mixpanel-react-native 1.3.2 → 1.3.6

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.
@@ -9,7 +9,7 @@ import { NativeModules } from 'react-native';
9
9
 
10
10
  test(`it calls MixpanelReactNative initialize`, async () => {
11
11
  const mixpanel = await Mixpanel.init("token");
12
- expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", false, {"$lib_version": "1.3.2", "mp_lib": "react-native"});
12
+ expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", false, {"$lib_version": "1.3.6", "mp_lib": "react-native"});
13
13
  });
14
14
 
15
15
  test(`it calls MixpanelReactNative setServerURL`, async () => {
@@ -1,6 +1,6 @@
1
1
  buildscript {
2
2
  repositories {
3
- jcenter()
3
+ mavenCentral()
4
4
  google()
5
5
  }
6
6
  dependencies {
@@ -25,7 +25,7 @@ android {
25
25
  }
26
26
 
27
27
  repositories {
28
- jcenter()
28
+ mavenCentral()
29
29
  maven {
30
30
  url 'https://maven.google.com/'
31
31
  name 'Google'
@@ -34,5 +34,5 @@ repositories {
34
34
 
35
35
  dependencies {
36
36
  implementation 'com.facebook.react:react-native:+'
37
- implementation 'com.mixpanel.android:mixpanel-android:5.9.1'
37
+ implementation 'com.mixpanel.android:mixpanel-android:6.0.0'
38
38
  }
@@ -34,9 +34,9 @@ public class MixpanelReactNativeModule extends ReactContextBaseJavaModule {
34
34
 
35
35
  @ReactMethod
36
36
  public void initialize(String token, boolean optOutTrackingDefault, ReadableMap metadata, Promise promise) throws JSONException {
37
- JSONObject sendProperties = ReactNativeHelper.reactToJSON(metadata);
38
- AutomaticProperties.setAutomaticProperties(sendProperties);
39
- MixpanelAPI.getInstance(this.mReactContext, token, optOutTrackingDefault);
37
+ JSONObject mixpanelProperties = ReactNativeHelper.reactToJSON(metadata);
38
+ AutomaticProperties.setAutomaticProperties(mixpanelProperties);
39
+ MixpanelAPI.getInstance(this.mReactContext, token, optOutTrackingDefault, mixpanelProperties);
40
40
  promise.resolve(null);
41
41
  }
42
42
 
@@ -4014,7 +4014,7 @@ To clear all superProperties, use clearSuperProperties()
4014
4014
  <br class="clear">
4015
4015
 
4016
4016
  <footer>
4017
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Aug 23 2021 15:47:04 GMT-0700 (Pacific Daylight Time)
4017
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Thu Jan 13 2022 14:18:25 GMT-0800 (Pacific Standard Time)
4018
4018
  </footer>
4019
4019
 
4020
4020
  <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.6</a> on Mon Aug 23 2021 15:47:04 GMT-0700 (Pacific Daylight Time)
960
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Thu Jan 13 2022 14:18:25 GMT-0800 (Pacific Standard 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.6</a> on Mon Aug 23 2021 15:47:04 GMT-0700 (Pacific Daylight Time)
1628
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Thu Jan 13 2022 14:18:25 GMT-0800 (Pacific Standard Time)
1629
1629
  </footer>
1630
1630
 
1631
1631
  <script> prettyPrint(); </script>
package/docs/index.html CHANGED
@@ -88,8 +88,10 @@ We'd also love for you to come and work with us! Check out <strong><a href="http
88
88
  </ol>
89
89
  <pre class="prettyprint source"><code>pod install
90
90
  </code></pre>
91
- <p>Please note: You do not need to update your Podfile to add Mixpanel.
92
- 3. For Xcode 12.5+, there is a known compile issue, please refer to this <strong><a href="https://github.com/mixpanel/mixpanel-react-native/issues/43#issuecomment-829599732">workaround</a></strong>.</p>
91
+ <p>Please note: You do not need to update your Podfile to add Mixpanel.</p>
92
+ <ol start="3">
93
+ <li>Since Xcode 12.5, there is a known swift compile issue, please refer to this <strong><a href="https://github.com/mixpanel/mixpanel-react-native/issues/43#issuecomment-829599732">workaround</a></strong>. However the compile issue has been resolved in Xcode 13.2.1+, there is no extra step required as long as you upgrade to Xcode 13.2.1+.</li>
94
+ </ol>
93
95
  <h3>2. Initialize Mixpanel</h3>
94
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>
95
97
  <pre class="prettyprint source lang-js"><code>import { Mixpanel } from 'mixpanel-react-native';
@@ -173,7 +175,7 @@ Please refer to our <a href="https://mixpanel.com/legal/app-store-privacy-detai
173
175
  <br class="clear">
174
176
 
175
177
  <footer>
176
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Aug 23 2021 15:47:04 GMT-0700 (Pacific Daylight Time)
178
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Thu Jan 13 2022 14:18:25 GMT-0800 (Pacific Standard Time)
177
179
  </footer>
178
180
 
179
181
  <script> prettyPrint(); </script>
@@ -888,7 +888,7 @@ class ObjectHelper {
888
888
  <br class="clear">
889
889
 
890
890
  <footer>
891
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Aug 23 2021 15:47:04 GMT-0700 (Pacific Daylight Time)
891
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Thu Jan 13 2022 14:18:25 GMT-0800 (Pacific Standard Time)
892
892
  </footer>
893
893
 
894
894
  <script> prettyPrint(); </script>
@@ -1,4 +1,3 @@
1
1
  struct Constants {
2
2
  static let DEFAULT_FLUSH_INTERVAL = 60.0
3
- static let AUTOMATIC_PUSH_TRACKING = false
4
3
  }
@@ -1,5 +1 @@
1
- #if __has_include("RCTBridgeModule.h")
2
- #import "RCTBridgeModule.h"
3
- #else
4
1
  #import <React/RCTBridgeModule.h>
5
- #endif
@@ -18,9 +18,9 @@ open class MixpanelReactNative: NSObject {
18
18
  resolver resolve: RCTPromiseResolveBlock,
19
19
  rejecter reject: RCTPromiseRejectBlock) -> Void {
20
20
  AutomaticProperties.setAutomaticProperties(properties)
21
- Mixpanel.initialize(token: token, launchOptions: nil, flushInterval: Constants.DEFAULT_FLUSH_INTERVAL, instanceName: token, automaticPushTracking: Constants.AUTOMATIC_PUSH_TRACKING, optOutTrackingByDefault: optOutTrackingByDefault)
22
- let instance = MixpanelReactNative.getMixpanelInstance(token)
23
- instance?.trackAutomaticEventsEnabled = false
21
+ Mixpanel.initialize(token: token, flushInterval: Constants.DEFAULT_FLUSH_INTERVAL,
22
+ instanceName: token, optOutTrackingByDefault: optOutTrackingByDefault,
23
+ superProperties: MixpanelTypeHandler.processProperties(properties: properties, includeLibInfo: true))
24
24
  resolve(true)
25
25
  }
26
26
 
@@ -312,7 +312,11 @@ open class MixpanelReactNative: NSObject {
312
312
  resolver resolve: RCTPromiseResolveBlock,
313
313
  rejecter reject: RCTPromiseRejectBlock) -> Void {
314
314
  let instance = MixpanelReactNative.getMixpanelInstance(token)
315
- instance?.setGroup(groupKey: groupKey, groupID: MixpanelTypeHandler.mixpanelTypeValue(groupID)!)
315
+ if groupID is Array<Any> {
316
+ instance?.setGroup(groupKey: groupKey, groupIDs:MixpanelTypeHandler.mixpanelTypeValue(groupID)! as! [MixpanelType])
317
+ } else {
318
+ instance?.setGroup(groupKey: groupKey, groupID:MixpanelTypeHandler.mixpanelTypeValue(groupID)!)
319
+ }
316
320
  resolve(nil)
317
321
  }
318
322
 
@@ -47,7 +47,7 @@
47
47
  return value.map { mixpanelTypeValue($0) }
48
48
 
49
49
  case let value as [String: Any]:
50
- return value
50
+ return value.mapValues { mixpanelTypeValue($0) }
51
51
 
52
52
  case let value as MixpanelType:
53
53
  return value
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mixpanel-react-native",
3
- "version": "1.3.2",
3
+ "version": "1.3.6",
4
4
  "description": "Official React Native Tracking Library for Mixpanel Analytics",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/release.py CHANGED
@@ -9,11 +9,11 @@ parser.add_argument('--new', help='version for the release', action="store")
9
9
  args = parser.parse_args()
10
10
 
11
11
  def bump_version():
12
- # replace_version('package.json', "\"version\": \"" + args.old + "\"", "\"version\": \"" + args.new + "\"")
13
- # replace_version('__tests__/index.test.js', "\"$lib_version\": \"" + args.old + "\"", "\"$lib_version\": \"" + args.new + "\"")
14
- # subprocess.call('cd Samples/MixpanelDemo;yarn upgrade mixpanel-react-native --latest', shell=True)
15
- # subprocess.call('cd Samples/SimpleMixpanel;yarn upgrade mixpanel-react-native --latest', shell=True)
16
- # subprocess.call('cd Samples/ContextAPIMixpanel;yarn upgrade mixpanel-react-native --latest', shell=True)
12
+ replace_version('package.json', "\"version\": \"" + args.old + "\"", "\"version\": \"" + args.new + "\"")
13
+ replace_version('__tests__/index.test.js', "\"$lib_version\": \"" + args.old + "\"", "\"$lib_version\": \"" + args.new + "\"")
14
+ subprocess.call('cd Samples/MixpanelDemo;yarn upgrade mixpanel-react-native --latest', shell=True)
15
+ subprocess.call('cd Samples/SimpleMixpanel;yarn upgrade mixpanel-react-native --latest', shell=True)
16
+ subprocess.call('cd Samples/ContextAPIMixpanel;yarn upgrade mixpanel-react-native --latest', shell=True)
17
17
  subprocess.call('git add package.json', shell=True)
18
18
  subprocess.call('git add __tests__/index.test.js', shell=True)
19
19
  subprocess.call('git add Samples/MixpanelDemo/yarn.lock', shell=True)