mixpanel-react-native 2.2.4 → 2.3.0

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.
@@ -469,7 +469,7 @@ Initializes Mixpanel and return an instance of Mixpanel the given project token.
469
469
 
470
470
  <dt class="tag-source">Source:</dt>
471
471
  <dd class="tag-source"><ul class="dummy"><li>
472
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line311">line 311</a>
472
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line322">line 322</a>
473
473
  </li></ul></dd>
474
474
 
475
475
 
@@ -519,8 +519,8 @@ Multiple aliases can point to the same identifier.
519
519
  `mixpane.alias("New ID", mixpane.distinctId)`
520
520
  `mixpane.alias("Newer ID", mixpane.distinctId)`
521
521
 
522
- <p>This call does not identify the user after. You must still call both identify() and
523
- People.identify() if you wish the new alias to be used for Events and People.
522
+ <p>This call does not identify the user after. You must still call identify()
523
+ if you wish the new alias to be used for Events and People.
524
524
  </div>
525
525
 
526
526
 
@@ -636,7 +636,7 @@ People.identify() if you wish the new alias to be used for Events and People.
636
636
 
637
637
  <dt class="tag-source">Source:</dt>
638
638
  <dd class="tag-source"><ul class="dummy"><li>
639
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line212">line 212</a>
639
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line223">line 223</a>
640
640
  </li></ul></dd>
641
641
 
642
642
 
@@ -729,7 +729,7 @@ superProperties registered before the clearSuperProperties method was called.
729
729
 
730
730
  <dt class="tag-source">Source:</dt>
731
731
  <dd class="tag-source"><ul class="dummy"><li>
732
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line419">line 419</a>
732
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line430">line 430</a>
733
733
  </li></ul></dd>
734
734
 
735
735
 
@@ -891,7 +891,7 @@ to Group Analytics using the same group value will create and store new values.<
891
891
 
892
892
  <dt class="tag-source">Source:</dt>
893
893
  <dd class="tag-source"><ul class="dummy"><li>
894
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line339">line 339</a>
894
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line350">line 350</a>
895
895
  </li></ul></dd>
896
896
 
897
897
 
@@ -1028,7 +1028,7 @@ to Group Analytics using the same group value will create and store new values.<
1028
1028
 
1029
1029
  <dt class="tag-source">Source:</dt>
1030
1030
  <dd class="tag-source"><ul class="dummy"><li>
1031
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line444">line 444</a>
1031
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line455">line 455</a>
1032
1032
  </li></ul></dd>
1033
1033
 
1034
1034
 
@@ -1144,7 +1144,7 @@ send all remaining messages to the server.
1144
1144
 
1145
1145
  <dt class="tag-source">Source:</dt>
1146
1146
  <dd class="tag-source"><ul class="dummy"><li>
1147
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line504">line 504</a>
1147
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line515">line 515</a>
1148
1148
  </li></ul></dd>
1149
1149
 
1150
1150
 
@@ -1240,7 +1240,7 @@ const deviceId = await mixpanel.getDeviceId();
1240
1240
 
1241
1241
  <dt class="tag-source">Source:</dt>
1242
1242
  <dd class="tag-source"><ul class="dummy"><li>
1243
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line491">line 491</a>
1243
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line502">line 502</a>
1244
1244
  </li></ul></dd>
1245
1245
 
1246
1246
 
@@ -1358,7 +1358,7 @@ const distinctId = await mixpanel.getDistinctId();
1358
1358
 
1359
1359
  <dt class="tag-source">Source:</dt>
1360
1360
  <dd class="tag-source"><ul class="dummy"><li>
1361
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line473">line 473</a>
1361
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line484">line 484</a>
1362
1362
  </li></ul></dd>
1363
1363
 
1364
1364
 
@@ -1541,7 +1541,7 @@ Group Analytics properties.
1541
1541
 
1542
1542
  <dt class="tag-source">Source:</dt>
1543
1543
  <dd class="tag-source"><ul class="dummy"><li>
1544
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line301">line 301</a>
1544
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line312">line 312</a>
1545
1545
  </li></ul></dd>
1546
1546
 
1547
1547
 
@@ -1641,7 +1641,7 @@ People Analytics properties.
1641
1641
 
1642
1642
  <dt class="tag-source">Source:</dt>
1643
1643
  <dd class="tag-source"><ul class="dummy"><li>
1644
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line251">line 251</a>
1644
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line262">line 262</a>
1645
1645
  </li></ul></dd>
1646
1646
 
1647
1647
 
@@ -1755,7 +1755,7 @@ and persist beyond the lifetime of your application.
1755
1755
 
1756
1756
  <dt class="tag-source">Source:</dt>
1757
1757
  <dd class="tag-source"><ul class="dummy"><li>
1758
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line407">line 407</a>
1758
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line418">line 418</a>
1759
1759
  </li></ul></dd>
1760
1760
 
1761
1761
 
@@ -1923,7 +1923,7 @@ and persist beyond the lifetime of your application.
1923
1923
 
1924
1924
 
1925
1925
 
1926
- <h4 class="name" id="identify"><span class="type-signature"></span>identify<span class="signature">(distinctId)</span><span class="type-signature"></span></h4>
1926
+ <h4 class="name" id="identify"><span class="type-signature"></span>identify<span class="signature">(distinctId)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
1927
1927
 
1928
1928
 
1929
1929
 
@@ -2036,7 +2036,7 @@ your application.
2036
2036
 
2037
2037
  <dt class="tag-source">Source:</dt>
2038
2038
  <dd class="tag-source"><ul class="dummy"><li>
2039
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line192">line 192</a>
2039
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line194">line 194</a>
2040
2040
  </li></ul></dd>
2041
2041
 
2042
2042
 
@@ -2061,6 +2061,29 @@ your application.
2061
2061
 
2062
2062
 
2063
2063
 
2064
+ <h5>Returns:</h5>
2065
+
2066
+
2067
+ <div class="param-desc">
2068
+ A promise that resolves when the identify is successful.
2069
+ It does not return any value.
2070
+ </div>
2071
+
2072
+
2073
+
2074
+ <dl>
2075
+ <dt>
2076
+ Type
2077
+ </dt>
2078
+ <dd>
2079
+
2080
+ <span class="param-type">Promise</span>
2081
+
2082
+
2083
+ </dd>
2084
+ </dl>
2085
+
2086
+
2064
2087
 
2065
2088
 
2066
2089
 
@@ -2564,7 +2587,7 @@ to remove a superProperty, call unregisterSuperProperty() or clearSuperPropertie
2564
2587
 
2565
2588
  <dt class="tag-source">Source:</dt>
2566
2589
  <dd class="tag-source"><ul class="dummy"><li>
2567
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line361">line 361</a>
2590
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line372">line 372</a>
2568
2591
  </li></ul></dd>
2569
2592
 
2570
2593
 
@@ -2704,7 +2727,7 @@ same names has already been registered.
2704
2727
 
2705
2728
  <dt class="tag-source">Source:</dt>
2706
2729
  <dd class="tag-source"><ul class="dummy"><li>
2707
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line376">line 376</a>
2730
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line387">line 387</a>
2708
2731
  </li></ul></dd>
2709
2732
 
2710
2733
 
@@ -2864,7 +2887,7 @@ same names has already been registered.
2864
2887
 
2865
2888
  <dt class="tag-source">Source:</dt>
2866
2889
  <dd class="tag-source"><ul class="dummy"><li>
2867
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line324">line 324</a>
2890
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line335">line 335</a>
2868
2891
  </li></ul></dd>
2869
2892
 
2870
2893
 
@@ -2953,7 +2976,7 @@ same names has already been registered.
2953
2976
 
2954
2977
  <dt class="tag-source">Source:</dt>
2955
2978
  <dd class="tag-source"><ul class="dummy"><li>
2956
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line455">line 455</a>
2979
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line466">line 466</a>
2957
2980
  </li></ul></dd>
2958
2981
 
2959
2982
 
@@ -3251,7 +3274,7 @@ when the app enters the background on iOS. This is set to true by default.
3251
3274
 
3252
3275
  <dt class="tag-source">Source:</dt>
3253
3276
  <dd class="tag-source"><ul class="dummy"><li>
3254
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line285">line 285</a>
3277
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line296">line 296</a>
3255
3278
  </li></ul></dd>
3256
3279
 
3257
3280
 
@@ -3808,7 +3831,7 @@ property, representing the number of seconds between your calls.
3808
3831
 
3809
3832
  <dt class="tag-source">Source:</dt>
3810
3833
  <dd class="tag-source"><ul class="dummy"><li>
3811
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line430">line 430</a>
3834
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line441">line 441</a>
3812
3835
  </li></ul></dd>
3813
3836
 
3814
3837
 
@@ -3974,7 +3997,7 @@ that event.
3974
3997
 
3975
3998
  <dt class="tag-source">Source:</dt>
3976
3999
  <dd class="tag-source"><ul class="dummy"><li>
3977
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line234">line 234</a>
4000
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line245">line 245</a>
3978
4001
  </li></ul></dd>
3979
4002
 
3980
4003
 
@@ -4163,7 +4186,7 @@ that event. Group key/value pairs are upserted into the property map before trac
4163
4186
 
4164
4187
  <dt class="tag-source">Source:</dt>
4165
4188
  <dd class="tag-source"><ul class="dummy"><li>
4166
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line269">line 269</a>
4189
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line280">line 280</a>
4167
4190
  </li></ul></dd>
4168
4191
 
4169
4192
 
@@ -4304,7 +4327,7 @@ To clear all superProperties, use clearSuperProperties()
4304
4327
 
4305
4328
  <dt class="tag-source">Source:</dt>
4306
4329
  <dd class="tag-source"><ul class="dummy"><li>
4307
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line392">line 392</a>
4330
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line403">line 403</a>
4308
4331
  </li></ul></dd>
4309
4332
 
4310
4333
 
@@ -4356,7 +4379,7 @@ To clear all superProperties, use clearSuperProperties()
4356
4379
  <br class="clear">
4357
4380
 
4358
4381
  <footer>
4359
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Wed Mar 22 2023 21:33:52 GMT-0700 (Pacific Daylight Time)
4382
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Fri Jun 16 2023 16:47:53 GMT-0700 (Pacific Daylight Time)
4360
4383
  </footer>
4361
4384
 
4362
4385
  <script> prettyPrint(); </script>
@@ -95,7 +95,7 @@
95
95
 
96
96
  <dt class="tag-source">Source:</dt>
97
97
  <dd class="tag-source"><ul class="dummy"><li>
98
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line721">line 721</a>
98
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line732">line 732</a>
99
99
  </li></ul></dd>
100
100
 
101
101
 
@@ -284,7 +284,7 @@ If the property exists and is not list-valued, the remove will be ignored.
284
284
 
285
285
  <dt class="tag-source">Source:</dt>
286
286
  <dd class="tag-source"><ul class="dummy"><li>
287
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line792">line 792</a>
287
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line803">line 803</a>
288
288
  </li></ul></dd>
289
289
 
290
290
 
@@ -446,7 +446,7 @@ possibly overwriting an existing property with the same name.
446
446
 
447
447
  <dt class="tag-source">Source:</dt>
448
448
  <dd class="tag-source"><ul class="dummy"><li>
449
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line740">line 740</a>
449
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line751">line 751</a>
450
450
  </li></ul></dd>
451
451
 
452
452
 
@@ -606,7 +606,7 @@ possibly overwriting an existing property with the same name.
606
606
 
607
607
  <dt class="tag-source">Source:</dt>
608
608
  <dd class="tag-source"><ul class="dummy"><li>
609
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line759">line 759</a>
609
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line770">line 770</a>
610
610
  </li></ul></dd>
611
611
 
612
612
 
@@ -768,7 +768,7 @@ If the property exists and is not list-valued, the union will be ignored.
768
768
 
769
769
  <dt class="tag-source">Source:</dt>
770
770
  <dd class="tag-source"><ul class="dummy"><li>
771
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line808">line 808</a>
771
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line819">line 819</a>
772
772
  </li></ul></dd>
773
773
 
774
774
 
@@ -905,7 +905,7 @@ If the property exists and is not list-valued, the union will be ignored.
905
905
 
906
906
  <dt class="tag-source">Source:</dt>
907
907
  <dd class="tag-source"><ul class="dummy"><li>
908
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line777">line 777</a>
908
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line788">line 788</a>
909
909
  </li></ul></dd>
910
910
 
911
911
 
@@ -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 Wed Mar 22 2023 21:33:52 GMT-0700 (Pacific Daylight Time)
960
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Fri Jun 16 2023 16:47:53 GMT-0700 (Pacific Daylight Time)
961
961
  </footer>
962
962
 
963
963
  <script> prettyPrint(); </script>
package/docs/People.html CHANGED
@@ -100,7 +100,7 @@ call to identify using a different id.</div>
100
100
 
101
101
  <dt class="tag-source">Source:</dt>
102
102
  <dd class="tag-source"><ul class="dummy"><li>
103
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line520">line 520</a>
103
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line531">line 531</a>
104
104
  </li></ul></dd>
105
105
 
106
106
 
@@ -289,7 +289,7 @@ currently have a list value, the append will be ignored.
289
289
 
290
290
  <dt class="tag-source">Source:</dt>
291
291
  <dd class="tag-source"><ul class="dummy"><li>
292
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line611">line 611</a>
292
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line622">line 622</a>
293
293
  </li></ul></dd>
294
294
 
295
295
 
@@ -377,7 +377,7 @@ currently have a list value, the append will be ignored.
377
377
 
378
378
  <dt class="tag-source">Source:</dt>
379
379
  <dd class="tag-source"><ul class="dummy"><li>
380
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line701">line 701</a>
380
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line712">line 712</a>
381
381
  </li></ul></dd>
382
382
 
383
383
 
@@ -468,7 +468,7 @@ to People Analytics using the same distinct id will create and store new values.
468
468
 
469
469
  <dt class="tag-source">Source:</dt>
470
470
  <dd class="tag-source"><ul class="dummy"><li>
471
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line711">line 711</a>
471
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line722">line 722</a>
472
472
  </li></ul></dd>
473
473
 
474
474
 
@@ -630,7 +630,7 @@ provide a negative number for the value.
630
630
 
631
631
  <dt class="tag-source">Source:</dt>
632
632
  <dd class="tag-source"><ul class="dummy"><li>
633
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line579">line 579</a>
633
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line590">line 590</a>
634
634
  </li></ul></dd>
635
635
 
636
636
 
@@ -792,7 +792,7 @@ If the property exists and is not list-valued, the remove will be ignored.
792
792
 
793
793
  <dt class="tag-source">Source:</dt>
794
794
  <dd class="tag-source"><ul class="dummy"><li>
795
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line655">line 655</a>
795
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line666">line 666</a>
796
796
  </li></ul></dd>
797
797
 
798
798
 
@@ -954,7 +954,7 @@ possibly overwriting an existing property with the same name.
954
954
 
955
955
  <dt class="tag-source">Source:</dt>
956
956
  <dd class="tag-source"><ul class="dummy"><li>
957
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line537">line 537</a>
957
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line548">line 548</a>
958
958
  </li></ul></dd>
959
959
 
960
960
 
@@ -1114,7 +1114,7 @@ possibly overwriting an existing property with the same name.
1114
1114
 
1115
1115
  <dt class="tag-source">Source:</dt>
1116
1116
  <dd class="tag-source"><ul class="dummy"><li>
1117
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line556">line 556</a>
1117
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line567">line 567</a>
1118
1118
  </li></ul></dd>
1119
1119
 
1120
1120
 
@@ -1274,7 +1274,7 @@ possibly overwriting an existing property with the same name.
1274
1274
 
1275
1275
  <dt class="tag-source">Source:</dt>
1276
1276
  <dd class="tag-source"><ul class="dummy"><li>
1277
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line687">line 687</a>
1277
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line698">line 698</a>
1278
1278
  </li></ul></dd>
1279
1279
 
1280
1280
 
@@ -1436,7 +1436,7 @@ If the property exists and is not list-valued, the union will be ignored.
1436
1436
 
1437
1437
  <dt class="tag-source">Source:</dt>
1438
1438
  <dd class="tag-source"><ul class="dummy"><li>
1439
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line634">line 634</a>
1439
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line645">line 645</a>
1440
1440
  </li></ul></dd>
1441
1441
 
1442
1442
 
@@ -1573,7 +1573,7 @@ If the property exists and is not list-valued, the union will be ignored.
1573
1573
 
1574
1574
  <dt class="tag-source">Source:</dt>
1575
1575
  <dd class="tag-source"><ul class="dummy"><li>
1576
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line674">line 674</a>
1576
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line685">line 685</a>
1577
1577
  </li></ul></dd>
1578
1578
 
1579
1579
 
@@ -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 Wed Mar 22 2023 21:33:52 GMT-0700 (Pacific Daylight Time)
1628
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Fri Jun 16 2023 16:47:53 GMT-0700 (Pacific Daylight Time)
1629
1629
  </footer>
1630
1630
 
1631
1631
  <script> prettyPrint(); </script>
package/docs/index.html CHANGED
@@ -44,7 +44,7 @@
44
44
 
45
45
  <section>
46
46
  <article><div align="center" style="text-align: center">
47
- <img src="https://github.com/mixpanel/mixpanel-android/blob/assets/mixpanel.png?raw=true" alt="Mixpanel React Native Library" height="150"/>
47
+ <img src="https://user-images.githubusercontent.com/71290498/231855346-12c8fc52-5f24-485c-b9e6-24468599fb87.png" alt="Mixpanel React Native Library" height="150"/>
48
48
  </div>
49
49
  <h5></h5>
50
50
  <h2>Table of Contents</h2>
@@ -138,6 +138,7 @@ const SampleApp = () => {
138
138
  export default SampleApp;
139
139
 
140
140
  </code></pre>
141
+ <h3>For Expo support, please refer to this <a href="https://github.com/mixpanel/mixpanel-react-native/issues/82">issue</a></h3>
141
142
  <p>👋 👋 Tell us about the Mixpanel developer experience! <a href="https://www.mixpanel.com/devnps">https://www.mixpanel.com/devnps</a> 👍 👎</p>
142
143
  <h2>FAQ</h2>
143
144
  <p><strong>I want to stop tracking an event/event property in Mixpanel. Is that possible?</strong><br>
@@ -145,7 +146,7 @@ Yes, in Lexicon, you can intercept and drop incoming events or properties. Mixpa
145
146
  <p><strong>I have a test user I would like to opt out of tracking. How do I do that?</strong><br>
146
147
  Mixpanel’s client-side tracking library contains the <a href="https://mixpanel.github.io/mixpanel-react-native/Mixpanel.html#optOutTracking">optOutTracking()</a> method, which will set the user’s local opt-out state to “true” and will prevent data from being sent from a user’s device. More detailed instructions can be found in the section, <a href="https://developer.mixpanel.com/docs/react-native#opting-users-out-of-tracking">Opting users out of tracking</a>.</p>
147
148
  <p><strong>Why aren't my events showing up?</strong><br>
148
- To preserve battery life and customer bandwidth, the Mixpanel library doesn't send the events you record immediately. Instead, it sends batches to the Mixpanel servers every 60 seconds while your application is running, as well as when the application transitions to the background. You can call <a href="https://mixpanel.github.io/mixpanel-react-native/Mixpanel.html#flush">flush()</a> manually if you want to force a flush at a particular moment.</p>
149
+ First, make sure your test device has internet access. To preserve battery life and customer bandwidth, the Mixpanel library doesn't send the events you record immediately. Instead, it sends batches to the Mixpanel servers every 60 seconds while your application is running, as well as when the application transitions to the background. You can call <a href="https://mixpanel.github.io/mixpanel-react-native/Mixpanel.html#flush">flush()</a> manually if you want to force a flush at a particular moment.</p>
149
150
  <pre class="prettyprint source"><code>mixpanel.flush();
150
151
  </code></pre>
151
152
  <p>If your events are still not showing up after 60 seconds, check if you have opted out of tracking. You can also enable Mixpanel debugging and logging, it allows you to see the debug output from the Mixpanel library. To enable it, call <a href="https://mixpanel.github.io/mixpanel-react-native/Mixpanel.html#setLoggingEnabled">setLoggingEnabled</a> with true, then run your iOS project with Xcode or android project with Android Studio. The logs should be available in the console.</p>
@@ -178,7 +179,7 @@ Please refer to our <a href="https://mixpanel.com/legal/app-store-privacy-detai
178
179
  <br class="clear">
179
180
 
180
181
  <footer>
181
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Wed Mar 22 2023 21:33:52 GMT-0700 (Pacific Daylight Time)
182
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Fri Jun 16 2023 16:47:53 GMT-0700 (Pacific Daylight Time)
182
183
  </footer>
183
184
 
184
185
  <script> prettyPrint(); </script>
@@ -113,7 +113,7 @@ export class Mixpanel {
113
113
  */
114
114
  static async init(token, trackAutomaticEvents, optOutTrackingDefault = DEFAULT_OPT_OUT) {
115
115
  let metadata = Helper.getMetaData();
116
- await MixpanelReactNative.initialize(token, trackAutomaticEvents, optOutTrackingDefault, metadata);
116
+ await MixpanelReactNative.initialize(token, trackAutomaticEvents, optOutTrackingDefault, metadata, "https://api.mixpanel.com");
117
117
  return new Mixpanel(token, trackAutomaticEvents);
118
118
  }
119
119
 
@@ -215,13 +215,24 @@ export class Mixpanel {
215
215
  * Mixpanel using the same disinct_id will be considered associated with the
216
216
  * same visitor/customer for retention and funnel reporting, so be sure that the given
217
217
  * value is globally unique for each individual user you intend to track.
218
- *
218
+ * @returns {Promise} A promise that resolves when the identify is successful.
219
+ * It does not return any value.
220
+ *
219
221
  */
220
222
  identify(distinctId) {
221
- if (!StringHelper.isValid(distinctId)) {
222
- StringHelper.raiseError(PARAMS.DISTINCT_ID);
223
- }
224
- MixpanelReactNative.identify(this.token, distinctId);
223
+ return new Promise((resolvem, reject) => {
224
+ if (!StringHelper.isValid(distinctId)) {
225
+ StringHelper.raiseError(PARAMS.DISTINCT_ID);
226
+ reject(new Error('Invalid distinctId'));
227
+ }
228
+ MixpanelReactNative.identify(this.token, distinctId)
229
+ .then(() => {
230
+ resolve();
231
+ })
232
+ .catch(err => {
233
+ reject(err);
234
+ });
235
+ });
225
236
  }
226
237
 
227
238
  /**
@@ -231,8 +242,8 @@ export class Mixpanel {
231
242
  * `mixpane.alias("New ID", mixpane.distinctId)`
232
243
  * `mixpane.alias("Newer ID", mixpane.distinctId)`
233
244
  *
234
- * &lt;p>This call does not identify the user after. You must still call both identify() and
235
- * People.identify() if you wish the new alias to be used for Events and People.
245
+ * &lt;p>This call does not identify the user after. You must still call identify()
246
+ * if you wish the new alias to be used for Events and People.
236
247
  *
237
248
  * @param {string} alias A unique identifier that you want to use as an identifier for this user.
238
249
  * @param {string} distinctId the current distinct_id that alias will be mapped to.
@@ -929,7 +940,7 @@ class ObjectHelper {
929
940
  <br class="clear">
930
941
 
931
942
  <footer>
932
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Wed Mar 22 2023 21:33:52 GMT-0700 (Pacific Daylight Time)
943
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Fri Jun 16 2023 16:47:53 GMT-0700 (Pacific Daylight Time)
933
944
  </footer>
934
945
 
935
946
  <script> prettyPrint(); </script>
package/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export class Mixpanel {
13
13
  hasOptedOutTracking(): Promise<boolean>;
14
14
  optInTracking(): void;
15
15
  optOutTracking(): void;
16
- identify(distinctId: string): void;
16
+ identify(distinctId: string): Promise<void>;
17
17
  alias(alias: string, distinctId: string): void
18
18
  track(eventName: string, properties?: MixpanelProperties): void
19
19
  getPeople(): People;
package/index.js CHANGED
@@ -85,7 +85,7 @@ export class Mixpanel {
85
85
  */
86
86
  static async init(token, trackAutomaticEvents, optOutTrackingDefault = DEFAULT_OPT_OUT) {
87
87
  let metadata = Helper.getMetaData();
88
- await MixpanelReactNative.initialize(token, trackAutomaticEvents, optOutTrackingDefault, metadata);
88
+ await MixpanelReactNative.initialize(token, trackAutomaticEvents, optOutTrackingDefault, metadata, "https://api.mixpanel.com");
89
89
  return new Mixpanel(token, trackAutomaticEvents);
90
90
  }
91
91
 
@@ -187,13 +187,24 @@ export class Mixpanel {
187
187
  * Mixpanel using the same disinct_id will be considered associated with the
188
188
  * same visitor/customer for retention and funnel reporting, so be sure that the given
189
189
  * value is globally unique for each individual user you intend to track.
190
- *
190
+ * @returns {Promise} A promise that resolves when the identify is successful.
191
+ * It does not return any value.
192
+ *
191
193
  */
192
194
  identify(distinctId) {
193
- if (!StringHelper.isValid(distinctId)) {
194
- StringHelper.raiseError(PARAMS.DISTINCT_ID);
195
- }
196
- MixpanelReactNative.identify(this.token, distinctId);
195
+ return new Promise((resolvem, reject) => {
196
+ if (!StringHelper.isValid(distinctId)) {
197
+ StringHelper.raiseError(PARAMS.DISTINCT_ID);
198
+ reject(new Error('Invalid distinctId'));
199
+ }
200
+ MixpanelReactNative.identify(this.token, distinctId)
201
+ .then(() => {
202
+ resolve();
203
+ })
204
+ .catch(err => {
205
+ reject(err);
206
+ });
207
+ });
197
208
  }
198
209
 
199
210
  /**
@@ -203,8 +214,8 @@ export class Mixpanel {
203
214
  * `mixpane.alias("New ID", mixpane.distinctId)`
204
215
  * `mixpane.alias("Newer ID", mixpane.distinctId)`
205
216
  *
206
- * <p>This call does not identify the user after. You must still call both identify() and
207
- * People.identify() if you wish the new alias to be used for Events and People.
217
+ * <p>This call does not identify the user after. You must still call identify()
218
+ * if you wish the new alias to be used for Events and People.
208
219
  *
209
220
  * @param {string} alias A unique identifier that you want to use as an identifier for this user.
210
221
  * @param {string} distinctId the current distinct_id that alias will be mapped to.
@@ -3,14 +3,10 @@ import Mixpanel
3
3
 
4
4
  class AutomaticProperties {
5
5
  static var peopleProperties: Dictionary<String, MixpanelType> = [:];
6
- private static let semaphore = DispatchSemaphore(value: 0)
7
-
8
6
 
9
7
  static func setAutomaticProperties(_ properties: [String: Any]) {
10
- semaphore.wait()
11
8
  for (key,value) in properties {
12
9
  peopleProperties[key] = MixpanelTypeHandler.mixpanelTypeValue(value)
13
10
  }
14
- semaphore.signal()
15
11
  }
16
12
  }
@@ -19,10 +19,12 @@ open class MixpanelReactNative: NSObject {
19
19
  serverURL: String,
20
20
  resolver resolve: RCTPromiseResolveBlock,
21
21
  rejecter reject: RCTPromiseRejectBlock) -> Void {
22
- AutomaticProperties.setAutomaticProperties(properties)
22
+ let autoProps = properties // copy
23
+ AutomaticProperties.setAutomaticProperties(autoProps)
24
+ let propsProcessed = MixpanelTypeHandler.processProperties(properties: autoProps)
23
25
  Mixpanel.initialize(token: token, trackAutomaticEvents: trackAutomaticEvents, flushInterval: Constants.DEFAULT_FLUSH_INTERVAL,
24
26
  instanceName: token, optOutTrackingByDefault: optOutTrackingByDefault,
25
- superProperties: MixpanelTypeHandler.processProperties(properties: properties, includeLibInfo: true),
27
+ superProperties: propsProcessed,
26
28
  serverURL: serverURL)
27
29
  resolve(true)
28
30
  }
@@ -101,7 +103,7 @@ open class MixpanelReactNative: NSObject {
101
103
  resolver resolve: RCTPromiseResolveBlock,
102
104
  rejecter reject: RCTPromiseRejectBlock) -> Void {
103
105
  let instance = MixpanelReactNative.getMixpanelInstance(token)
104
- let mpProperties = MixpanelTypeHandler.processProperties(properties: properties, includeLibInfo: true)
106
+ let mpProperties = MixpanelTypeHandler.processProperties(properties: properties)
105
107
  instance?.track(event: event, properties: mpProperties)
106
108
  resolve(nil)
107
109
  }
@@ -129,11 +131,12 @@ open class MixpanelReactNative: NSObject {
129
131
 
130
132
  @objc
131
133
  func identify(_ token: String, distinctId: String,
132
- resolver resolve: RCTPromiseResolveBlock,
133
- rejecter reject: RCTPromiseRejectBlock) -> Void {
134
+ resolver resolve: @escaping RCTPromiseResolveBlock,
135
+ rejecter reject: @escaping RCTPromiseRejectBlock) -> Void {
134
136
  let instance = MixpanelReactNative.getMixpanelInstance(token)
135
- instance?.identify(distinctId: distinctId)
136
- resolve(nil)
137
+ instance?.identify(distinctId: distinctId) {
138
+ resolve(nil)
139
+ }
137
140
  }
138
141
 
139
142
  @objc
@@ -318,7 +321,7 @@ open class MixpanelReactNative: NSObject {
318
321
  resolver resolve: RCTPromiseResolveBlock,
319
322
  rejecter reject: RCTPromiseRejectBlock) -> Void {
320
323
  let instance = MixpanelReactNative.getMixpanelInstance(token)
321
- let mpProperties = MixpanelTypeHandler.processProperties(properties: properties, includeLibInfo: true)
324
+ let mpProperties = MixpanelTypeHandler.processProperties(properties: properties)
322
325
  var mpGroups = Dictionary<String, MixpanelType>()
323
326
  for (key,value) in groups ?? [:] {
324
327
  mpGroups[key] = MixpanelTypeHandler.mixpanelTypeValue(value)