react-native-purchases 5.3.2 → 5.4.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.
@@ -24,6 +24,6 @@ Pod::Spec.new do |spec|
24
24
  ]
25
25
 
26
26
  spec.dependency "React-Core"
27
- spec.dependency "PurchasesHybridCommon", '4.5.2'
27
+ spec.dependency "PurchasesHybridCommon", '4.5.4'
28
28
  spec.swift_version = '5.0'
29
29
  end
@@ -29,7 +29,7 @@ android {
29
29
  minSdkVersion getExtOrIntegerDefault('minSdkVersion')
30
30
  targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
31
31
  versionCode 1
32
- versionName '5.3.2'
32
+ versionName '5.4.0'
33
33
  }
34
34
 
35
35
  buildTypes {
@@ -121,6 +121,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
121
121
  dependencies {
122
122
  //noinspection GradleDynamicVersion
123
123
  api 'com.facebook.react:react-native:+'
124
- implementation 'com.revenuecat.purchases:purchases-hybrid-common:4.5.2'
124
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:4.5.4'
125
125
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
126
126
  }
@@ -287,6 +287,21 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
287
287
  SubscriberAttributesKt.setMparticleID(mparticleID);
288
288
  }
289
289
 
290
+ @ReactMethod
291
+ public void setCleverTapID(String cleverTapID) {
292
+ SubscriberAttributesKt.setCleverTapID(cleverTapID);
293
+ }
294
+
295
+ @ReactMethod
296
+ public void setMixpanelDistinctID(String mixpanelDistinctID) {
297
+ SubscriberAttributesKt.setMixpanelDistinctID(mixpanelDistinctID);
298
+ }
299
+
300
+ @ReactMethod
301
+ public void setFirebaseAppInstanceID(String firebaseAppInstanceId) {
302
+ SubscriberAttributesKt.setFirebaseAppInstanceID(firebaseAppInstanceId);
303
+ }
304
+
290
305
  @ReactMethod
291
306
  public void setOnesignalID(String onesignalID) {
292
307
  SubscriberAttributesKt.setOnesignalID(onesignalID);
@@ -420,7 +420,7 @@ export default class Purchases {
420
420
  * Subscriber attribute associated with the Adjust Id for the user
421
421
  * Required for the RevenueCat Adjust integration
422
422
  *
423
- * @param adjustID Empty String or null will delete the subscriber attribute.
423
+ * @param adjustID Adjust ID to use in Adjust integration. Empty String or null will delete the subscriber attribute.
424
424
  * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
425
425
  * setting Adjust ID.
426
426
  */
@@ -428,7 +428,7 @@ export default class Purchases {
428
428
  /**
429
429
  * Subscriber attribute associated with the AppsFlyer Id for the user
430
430
  * Required for the RevenueCat AppsFlyer integration
431
- * @param appsflyerID Empty String or null will delete the subscriber attribute.
431
+ * @param appsflyerID Appsflyer ID to use in Appsflyer integration. Empty String or null will delete the subscriber attribute.
432
432
  * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
433
433
  * setting the Appsflyer ID.
434
434
  */
@@ -437,7 +437,7 @@ export default class Purchases {
437
437
  * Subscriber attribute associated with the Facebook SDK Anonymous Id for the user
438
438
  * Recommended for the RevenueCat Facebook integration
439
439
  *
440
- * @param fbAnonymousID Empty String or null will delete the subscriber attribute.
440
+ * @param fbAnonymousID Facebook Anonymous ID to use in Mparticle integration. Empty String or null will delete the subscriber attribute.
441
441
  * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
442
442
  * setting the Facebook Anonymous ID.
443
443
  */
@@ -446,25 +446,52 @@ export default class Purchases {
446
446
  * Subscriber attribute associated with the mParticle Id for the user
447
447
  * Recommended for the RevenueCat mParticle integration
448
448
  *
449
- * @param mparticleID Empty String or null will delete the subscriber attribute.
449
+ * @param mparticleID Mparticle ID to use in Mparticle integration. Empty String or null will delete the subscriber attribute.
450
450
  * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
451
451
  * setting the Mparticle ID.
452
452
  */
453
453
  static setMparticleID(mparticleID: string | null): Promise<void>;
454
+ /**
455
+ * Subscriber attribute associated with the CleverTap Id for the user
456
+ * Required for the RevenueCat CleverTap integration
457
+ *
458
+ * @param cleverTapID CleverTap user ID to use in CleverTap integration. Empty String or null will delete the subscriber attribute.
459
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
460
+ * setting the CleverTap ID.
461
+ */
462
+ static setCleverTapID(cleverTapID: string | null): Promise<void>;
463
+ /**
464
+ * Subscriber attribute associated with the Mixpanel Distinct Id for the user
465
+ * Required for the RevenueCat Mixpanel integration
466
+ *
467
+ * @param mixpanelDistinctID Mixpanel Distinct ID to use in Mixpanel integration. Empty String or null will delete the subscriber attribute.
468
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
469
+ * setting the Mixpanel Distinct ID.
470
+ */
471
+ static setMixpanelDistinctID(mixpanelDistinctID: string | null): Promise<void>;
472
+ /**
473
+ * Subscriber attribute associated with the Firebase App Instance ID for the user
474
+ * Required for the RevenueCat Firebase integration
475
+ *
476
+ * @param firebaseAppInstanceID Firebase App Instance ID to use in Firebase integration. Empty String or null will delete the subscriber attribute.
477
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
478
+ * setting the Firebase App Instance ID.
479
+ */
480
+ static setFirebaseAppInstanceID(firebaseAppInstanceID: string | null): Promise<void>;
454
481
  /**
455
482
  * Subscriber attribute associated with the OneSignal Player Id for the user
456
483
  * Required for the RevenueCat OneSignal integration
457
484
  *
458
- * @param onesignalID Empty String or null will delete the subscriber attribute.
485
+ * @param onesignalID OneSignal Player ID to use in OneSignal integration. Empty String or null will delete the subscriber attribute.
459
486
  * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
460
- * setting the Onesignal ID.
487
+ * setting the OneSignal ID.
461
488
  */
462
489
  static setOnesignalID(onesignalID: string | null): Promise<void>;
463
490
  /**
464
491
  * Subscriber attribute associated with the Airship Channel Id for the user
465
492
  * Required for the RevenueCat Airship integration
466
493
  *
467
- * @param airshipChannelID Empty String or null will delete the subscriber attribute.
494
+ * @param airshipChannelID Airship Channel ID to use in Airship integration. Empty String or null will delete the subscriber attribute.
468
495
  * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
469
496
  * setting the Airship Channel ID.
470
497
  */
package/dist/purchases.js CHANGED
@@ -798,7 +798,7 @@ var Purchases = /** @class */ (function () {
798
798
  * Subscriber attribute associated with the Adjust Id for the user
799
799
  * Required for the RevenueCat Adjust integration
800
800
  *
801
- * @param adjustID Empty String or null will delete the subscriber attribute.
801
+ * @param adjustID Adjust ID to use in Adjust integration. Empty String or null will delete the subscriber attribute.
802
802
  * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
803
803
  * setting Adjust ID.
804
804
  */
@@ -818,7 +818,7 @@ var Purchases = /** @class */ (function () {
818
818
  /**
819
819
  * Subscriber attribute associated with the AppsFlyer Id for the user
820
820
  * Required for the RevenueCat AppsFlyer integration
821
- * @param appsflyerID Empty String or null will delete the subscriber attribute.
821
+ * @param appsflyerID Appsflyer ID to use in Appsflyer integration. Empty String or null will delete the subscriber attribute.
822
822
  * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
823
823
  * setting the Appsflyer ID.
824
824
  */
@@ -839,7 +839,7 @@ var Purchases = /** @class */ (function () {
839
839
  * Subscriber attribute associated with the Facebook SDK Anonymous Id for the user
840
840
  * Recommended for the RevenueCat Facebook integration
841
841
  *
842
- * @param fbAnonymousID Empty String or null will delete the subscriber attribute.
842
+ * @param fbAnonymousID Facebook Anonymous ID to use in Mparticle integration. Empty String or null will delete the subscriber attribute.
843
843
  * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
844
844
  * setting the Facebook Anonymous ID.
845
845
  */
@@ -860,7 +860,7 @@ var Purchases = /** @class */ (function () {
860
860
  * Subscriber attribute associated with the mParticle Id for the user
861
861
  * Recommended for the RevenueCat mParticle integration
862
862
  *
863
- * @param mparticleID Empty String or null will delete the subscriber attribute.
863
+ * @param mparticleID Mparticle ID to use in Mparticle integration. Empty String or null will delete the subscriber attribute.
864
864
  * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
865
865
  * setting the Mparticle ID.
866
866
  */
@@ -877,13 +877,76 @@ var Purchases = /** @class */ (function () {
877
877
  });
878
878
  });
879
879
  };
880
+ /**
881
+ * Subscriber attribute associated with the CleverTap Id for the user
882
+ * Required for the RevenueCat CleverTap integration
883
+ *
884
+ * @param cleverTapID CleverTap user ID to use in CleverTap integration. Empty String or null will delete the subscriber attribute.
885
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
886
+ * setting the CleverTap ID.
887
+ */
888
+ Purchases.setCleverTapID = function (cleverTapID) {
889
+ return __awaiter(this, void 0, void 0, function () {
890
+ return __generator(this, function (_a) {
891
+ switch (_a.label) {
892
+ case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
893
+ case 1:
894
+ _a.sent();
895
+ RNPurchases.setCleverTapID(cleverTapID);
896
+ return [2 /*return*/];
897
+ }
898
+ });
899
+ });
900
+ };
901
+ /**
902
+ * Subscriber attribute associated with the Mixpanel Distinct Id for the user
903
+ * Required for the RevenueCat Mixpanel integration
904
+ *
905
+ * @param mixpanelDistinctID Mixpanel Distinct ID to use in Mixpanel integration. Empty String or null will delete the subscriber attribute.
906
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
907
+ * setting the Mixpanel Distinct ID.
908
+ */
909
+ Purchases.setMixpanelDistinctID = function (mixpanelDistinctID) {
910
+ return __awaiter(this, void 0, void 0, function () {
911
+ return __generator(this, function (_a) {
912
+ switch (_a.label) {
913
+ case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
914
+ case 1:
915
+ _a.sent();
916
+ RNPurchases.setMixpanelDistinctID(mixpanelDistinctID);
917
+ return [2 /*return*/];
918
+ }
919
+ });
920
+ });
921
+ };
922
+ /**
923
+ * Subscriber attribute associated with the Firebase App Instance ID for the user
924
+ * Required for the RevenueCat Firebase integration
925
+ *
926
+ * @param firebaseAppInstanceID Firebase App Instance ID to use in Firebase integration. Empty String or null will delete the subscriber attribute.
927
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
928
+ * setting the Firebase App Instance ID.
929
+ */
930
+ Purchases.setFirebaseAppInstanceID = function (firebaseAppInstanceID) {
931
+ return __awaiter(this, void 0, void 0, function () {
932
+ return __generator(this, function (_a) {
933
+ switch (_a.label) {
934
+ case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
935
+ case 1:
936
+ _a.sent();
937
+ RNPurchases.setFirebaseAppInstanceID(firebaseAppInstanceID);
938
+ return [2 /*return*/];
939
+ }
940
+ });
941
+ });
942
+ };
880
943
  /**
881
944
  * Subscriber attribute associated with the OneSignal Player Id for the user
882
945
  * Required for the RevenueCat OneSignal integration
883
946
  *
884
- * @param onesignalID Empty String or null will delete the subscriber attribute.
947
+ * @param onesignalID OneSignal Player ID to use in OneSignal integration. Empty String or null will delete the subscriber attribute.
885
948
  * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
886
- * setting the Onesignal ID.
949
+ * setting the OneSignal ID.
887
950
  */
888
951
  Purchases.setOnesignalID = function (onesignalID) {
889
952
  return __awaiter(this, void 0, void 0, function () {
@@ -902,7 +965,7 @@ var Purchases = /** @class */ (function () {
902
965
  * Subscriber attribute associated with the Airship Channel Id for the user
903
966
  * Required for the RevenueCat Airship integration
904
967
  *
905
- * @param airshipChannelID Empty String or null will delete the subscriber attribute.
968
+ * @param airshipChannelID Airship Channel ID to use in Airship integration. Empty String or null will delete the subscriber attribute.
906
969
  * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
907
970
  * setting the Airship Channel ID.
908
971
  */
package/ios/RNPurchases.m CHANGED
@@ -265,6 +265,18 @@ RCT_EXPORT_METHOD(setMparticleID:(NSString *)mparticleID) {
265
265
  [RCCommonFunctionality setMparticleID:mparticleID];
266
266
  }
267
267
 
268
+ RCT_EXPORT_METHOD(setCleverTapID:(NSString *)cleverTapID) {
269
+ [RCCommonFunctionality setCleverTapID:cleverTapID];
270
+ }
271
+
272
+ RCT_EXPORT_METHOD(setMixpanelDistinctID:(NSString *)mixpanelDistinctID) {
273
+ [RCCommonFunctionality setMixpanelDistinctID:mixpanelDistinctID];
274
+ }
275
+
276
+ RCT_EXPORT_METHOD(setFirebaseAppInstanceID:(NSString *)firebaseAppInstanceId) {
277
+ [RCCommonFunctionality setFirebaseAppInstanceID:firebaseAppInstanceId];
278
+ }
279
+
268
280
  RCT_EXPORT_METHOD(setOnesignalID:(NSString *)onesignalID) {
269
281
  [RCCommonFunctionality setOnesignalID:onesignalID];
270
282
  }
@@ -354,7 +366,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
354
366
  }
355
367
 
356
368
  - (NSString *)platformFlavorVersion {
357
- return @"5.3.2";
369
+ return @"5.4.0";
358
370
  }
359
371
 
360
372
  @end
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-purchases",
3
3
  "title": "React Native Purchases",
4
- "version": "5.3.2",
4
+ "version": "5.4.0",
5
5
  "description": "React Native in-app purchases and subscriptions made easy. Supports iOS and Android. ",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -33,7 +33,7 @@
33
33
  "tslint": "tslint -c tslint.json 'src/*.ts'",
34
34
  "prepublish": "tsc",
35
35
  "example": "yarn --cwd examples/MagicWeather && yarn --cwd examples/purchaseTesterTypescript",
36
- "pods": "(cd examples/MagicWeather && npx pod-install --quiet) && (cd examples/purchaseTesterTypescript && npx pod-install --quiet)",
36
+ "pods": "(cd examples/MagicWeather && rm -f ios/Podfile.lock && npx pod-install --quiet) && (cd examples/purchaseTesterTypescript && rm -f ios/Podfile.lock && npx pod-install --quiet)",
37
37
  "bootstrap": "yarn example && yarn && yarn pods"
38
38
  },
39
39
  "repository": {
@@ -2,7 +2,7 @@
2
2
  <!DOCTYPE html>
3
3
  <html>
4
4
  <head>
5
- <meta http-equiv="refresh" content="0; url=https://revenuecat.github.io/react-native-purchases-docs/5.3.2/" />
5
+ <meta http-equiv="refresh" content="0; url=https://revenuecat.github.io/react-native-purchases-docs/5.4.0/" />
6
6
  </head>
7
7
  <body>
8
8
  </body>
@@ -714,6 +714,9 @@ NativeModules.RNPurchases = {
714
714
  setPhoneNumber: jest.fn(),
715
715
  setDisplayName: jest.fn(),
716
716
  setPushToken: jest.fn(),
717
+ setCleverTapID: jest.fn(),
718
+ setMixpanelDistinctID: jest.fn(),
719
+ setFirebaseAppInstanceID: jest.fn(),
717
720
  canMakePayments: jest.fn(),
718
721
  isConfigured: jest.fn()
719
722
  };