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.
- package/.github/workflows/node.js.yml +1 -1
- package/.github/workflows/release.yml +4 -4
- package/CHANGELOG.md +98 -0
- package/MixpanelReactNative.podspec +1 -1
- package/README.md +2 -1
- package/Samples/ContextAPIMixpanel/android/.project +28 -0
- package/Samples/ContextAPIMixpanel/yarn.lock +4 -4
- package/Samples/MixpanelDemo/android/.project +28 -0
- package/Samples/MixpanelDemo/ios/MixpanelDemo.xcodeproj/project.pbxproj +0 -20
- package/Samples/MixpanelDemo/package.json +1 -1
- package/Samples/MixpanelDemo/yarn.lock +11 -11
- 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 +3 -3
- 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 -4
- package/ios/MixpanelTypeHandler.swift +1 -1
- package/package.json +1 -1
- package/release.py +5 -5
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.6", "mp_lib": "react-native"});
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
test(`it calls MixpanelReactNative setServerURL`, async () => {
|
package/android/build.gradle
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
buildscript {
|
|
2
2
|
repositories {
|
|
3
|
-
|
|
3
|
+
mavenCentral()
|
|
4
4
|
google()
|
|
5
5
|
}
|
|
6
6
|
dependencies {
|
|
@@ -25,7 +25,7 @@ android {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
repositories {
|
|
28
|
-
|
|
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:
|
|
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
|
|
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 Thu Jan 13 2022 14:18:25 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 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
|
|
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
|
-
|
|
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 Thu Jan 13 2022 14:18:25 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 Thu Jan 13 2022 14:18:25 GMT-0800 (Pacific Standard Time)
|
|
892
892
|
</footer>
|
|
893
893
|
|
|
894
894
|
<script> prettyPrint(); </script>
|
package/ios/Constants.swift
CHANGED
|
@@ -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,
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
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
|
|
package/package.json
CHANGED
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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)
|