mixpanel-react-native 1.3.3 → 1.3.7
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/.github/workflows/node.js.yml +1 -1
- package/.github/workflows/release.yml +4 -4
- package/CHANGELOG.md +62 -0
- package/LICENSE +1 -1
- package/MixpanelReactNative.podspec +1 -1
- package/README.md +2 -1
- package/Samples/ContextAPIMixpanel/android/.project +28 -0
- package/Samples/ContextAPIMixpanel/package.json +1 -1
- package/Samples/ContextAPIMixpanel/yarn.lock +1 -1
- package/Samples/MixpanelDemo/android/.project +28 -0
- package/Samples/MixpanelDemo/ios/MixpanelDemo.xcodeproj/project.pbxproj +0 -20
- package/Samples/MixpanelDemo/yarn.lock +1 -1
- package/Samples/SimpleMixpanel/android/.project +28 -0
- package/Samples/SimpleMixpanel/yarn.lock +1464 -1405
- package/__tests__/index.test.js +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/mixpanel/reactnative/MixpanelReactNativeModule.java +3 -3
- 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/ios/Constants.swift +0 -1
- package/ios/MixpanelReactNative-Bridging-Header.h +0 -4
- package/ios/MixpanelReactNative.swift +8 -2
- package/ios/MixpanelTypeHandler.swift +1 -1
- package/package.json +1 -1
package/__tests__/index.test.js
CHANGED
|
@@ -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.
|
|
12
|
+
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", false, {"$lib_version": "1.3.7", "mp_lib": "react-native"});
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
test(`it calls MixpanelReactNative setServerURL`, async () => {
|
package/android/build.gradle
CHANGED
|
@@ -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
|
|
38
|
-
AutomaticProperties.setAutomaticProperties(
|
|
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
|
|
package/docs/Mixpanel.html
CHANGED
|
@@ -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
|
|
4017
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Wed Jan 26 2022 15:11:22 GMT-0800 (Pacific Standard Time)
|
|
4018
4018
|
</footer>
|
|
4019
4019
|
|
|
4020
4020
|
<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.6</a> on
|
|
960
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Wed Jan 26 2022 15:11:22 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
|
|
1628
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Wed Jan 26 2022 15:11:22 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
|
-
|
|
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
|
|
178
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Wed Jan 26 2022 15:11:22 GMT-0800 (Pacific Standard Time)
|
|
177
179
|
</footer>
|
|
178
180
|
|
|
179
181
|
<script> prettyPrint(); </script>
|
package/docs/index.js.html
CHANGED
|
@@ -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
|
|
891
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Wed Jan 26 2022 15:11:22 GMT-0800 (Pacific Standard Time)
|
|
892
892
|
</footer>
|
|
893
893
|
|
|
894
894
|
<script> prettyPrint(); </script>
|
package/ios/Constants.swift
CHANGED
|
@@ -18,7 +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,
|
|
21
|
+
Mixpanel.initialize(token: token, flushInterval: Constants.DEFAULT_FLUSH_INTERVAL,
|
|
22
|
+
instanceName: token, optOutTrackingByDefault: optOutTrackingByDefault,
|
|
23
|
+
superProperties: MixpanelTypeHandler.processProperties(properties: properties, includeLibInfo: true))
|
|
22
24
|
resolve(true)
|
|
23
25
|
}
|
|
24
26
|
|
|
@@ -310,7 +312,11 @@ open class MixpanelReactNative: NSObject {
|
|
|
310
312
|
resolver resolve: RCTPromiseResolveBlock,
|
|
311
313
|
rejecter reject: RCTPromiseRejectBlock) -> Void {
|
|
312
314
|
let instance = MixpanelReactNative.getMixpanelInstance(token)
|
|
313
|
-
|
|
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
|
+
}
|
|
314
320
|
resolve(nil)
|
|
315
321
|
}
|
|
316
322
|
|