react-native-purchases 10.6.0 → 10.7.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.
@@ -25,6 +25,6 @@ Pod::Spec.new do |spec|
25
25
  ]
26
26
 
27
27
  spec.dependency "React-Core"
28
- spec.dependency "PurchasesHybridCommon", '18.28.0'
28
+ spec.dependency "PurchasesHybridCommon", '18.29.0'
29
29
  spec.swift_version = '5.7'
30
30
  end
@@ -29,7 +29,7 @@ android {
29
29
  minSdkVersion getExtOrIntegerDefault('minSdkVersion')
30
30
  targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
31
31
  versionCode 1
32
- versionName '10.6.0'
32
+ versionName '10.7.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:18.28.0'
124
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:18.29.0'
125
125
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
126
126
  }
@@ -51,7 +51,7 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
51
51
  private static final String TRACKED_EVENT = "Purchases-TrackedEvent";
52
52
  private static final String DEBUG_EVENT = "Purchases-DebugEvent";
53
53
  public static final String PLATFORM_NAME = "react-native";
54
- public static final String PLUGIN_VERSION = "10.6.0";
54
+ public static final String PLUGIN_VERSION = "10.7.0";
55
55
 
56
56
  private final ReactApplicationContext reactContext;
57
57
 
@@ -506,6 +506,11 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
506
506
  SubscriberAttributesKt.setOnesignalID(onesignalID);
507
507
  }
508
508
 
509
+ @ReactMethod
510
+ public void setOnesignalUserID(String onesignalUserID) {
511
+ SubscriberAttributesKt.setOnesignalUserID(onesignalUserID);
512
+ }
513
+
509
514
  @ReactMethod
510
515
  public void setAirshipChannelID(String airshipChannelID) {
511
516
  SubscriberAttributesKt.setAirshipChannelID(airshipChannelID);
@@ -63,6 +63,7 @@ export declare const browserNativeModuleRNPurchases: {
63
63
  setTenjinAnalyticsInstallationID: (_tenjinAnalyticsInstallationID: string) => Promise<void>;
64
64
  setKochavaDeviceID: (_kochavaDeviceID: string) => Promise<void>;
65
65
  setOnesignalID: (_onesignalID: string) => Promise<void>;
66
+ setOnesignalUserID: (_onesignalUserID: string) => Promise<void>;
66
67
  setAirshipChannelID: (_airshipChannelID: string) => Promise<void>;
67
68
  setMediaSource: (_mediaSource: string) => Promise<void>;
68
69
  setMediaCampaign: () => Promise<void>;
@@ -463,6 +463,12 @@ exports.browserNativeModuleRNPurchases = {
463
463
  return [2 /*return*/];
464
464
  });
465
465
  }); },
466
+ setOnesignalUserID: function (_onesignalUserID) { return __awaiter(void 0, void 0, void 0, function () {
467
+ return __generator(this, function (_a) {
468
+ (0, utils_1.methodNotSupportedOnWeb)('setOnesignalUserID');
469
+ return [2 /*return*/];
470
+ });
471
+ }); },
466
472
  setAirshipChannelID: function (_airshipChannelID) { return __awaiter(void 0, void 0, void 0, function () {
467
473
  return __generator(this, function (_a) {
468
474
  (0, utils_1.methodNotSupportedOnWeb)('setAirshipChannelID');
@@ -835,13 +835,24 @@ export default class Purchases {
835
835
  static setKochavaDeviceID(kochavaDeviceID: string | null): Promise<void>;
836
836
  /**
837
837
  * Subscriber attribute associated with the OneSignal Player Id for the user
838
- * Required for the RevenueCat OneSignal integration
838
+ * Required for the RevenueCat OneSignal integration with OneSignal SDK v4.0 and below
839
+ * (OneSignal API v9). For OneSignal SDK v5.0 and above, use {@link setOnesignalUserID} instead.
839
840
  *
840
841
  * @param onesignalID OneSignal Player ID to use in OneSignal integration. Empty String or null will delete the subscriber attribute.
841
842
  * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
842
843
  * setting the OneSignal ID.
843
844
  */
844
845
  static setOnesignalID(onesignalID: string | null): Promise<void>;
846
+ /**
847
+ * Subscriber attribute associated with the OneSignal User ID for the user
848
+ * Required for the RevenueCat OneSignal integration with OneSignal SDK v5.0
849
+ * and above (OneSignal API v11+).
850
+ *
851
+ * @param onesignalUserID OneSignal User ID to use in OneSignal integration. Empty String or null will delete the subscriber attribute.
852
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
853
+ * setting the OneSignal user ID.
854
+ */
855
+ static setOnesignalUserID(onesignalUserID: string | null): Promise<void>;
845
856
  /**
846
857
  * Subscriber attribute associated with the Airship Channel Id for the user
847
858
  * Required for the RevenueCat Airship integration
package/dist/purchases.js CHANGED
@@ -1551,7 +1551,8 @@ var Purchases = /** @class */ (function () {
1551
1551
  };
1552
1552
  /**
1553
1553
  * Subscriber attribute associated with the OneSignal Player Id for the user
1554
- * Required for the RevenueCat OneSignal integration
1554
+ * Required for the RevenueCat OneSignal integration with OneSignal SDK v4.0 and below
1555
+ * (OneSignal API v9). For OneSignal SDK v5.0 and above, use {@link setOnesignalUserID} instead.
1555
1556
  *
1556
1557
  * @param onesignalID OneSignal Player ID to use in OneSignal integration. Empty String or null will delete the subscriber attribute.
1557
1558
  * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
@@ -1570,6 +1571,28 @@ var Purchases = /** @class */ (function () {
1570
1571
  });
1571
1572
  });
1572
1573
  };
1574
+ /**
1575
+ * Subscriber attribute associated with the OneSignal User ID for the user
1576
+ * Required for the RevenueCat OneSignal integration with OneSignal SDK v5.0
1577
+ * and above (OneSignal API v11+).
1578
+ *
1579
+ * @param onesignalUserID OneSignal User ID to use in OneSignal integration. Empty String or null will delete the subscriber attribute.
1580
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
1581
+ * setting the OneSignal user ID.
1582
+ */
1583
+ Purchases.setOnesignalUserID = function (onesignalUserID) {
1584
+ return __awaiter(this, void 0, void 0, function () {
1585
+ return __generator(this, function (_a) {
1586
+ switch (_a.label) {
1587
+ case 0: return [4 /*yield*/, throwIfNotConfigured()];
1588
+ case 1:
1589
+ _a.sent();
1590
+ RNPurchases.setOnesignalUserID(onesignalUserID);
1591
+ return [2 /*return*/];
1592
+ }
1593
+ });
1594
+ });
1595
+ };
1573
1596
  /**
1574
1597
  * Subscriber attribute associated with the Airship Channel Id for the user
1575
1598
  * Required for the RevenueCat Airship integration
package/ios/RNPurchases.m CHANGED
@@ -445,6 +445,10 @@ RCT_EXPORT_METHOD(setOnesignalID:(NSString *)onesignalID) {
445
445
  [RCCommonFunctionality setOnesignalID:onesignalID.mappingNSNullToNil];
446
446
  }
447
447
 
448
+ RCT_EXPORT_METHOD(setOnesignalUserID:(NSString *)onesignalUserID) {
449
+ [RCCommonFunctionality setOnesignalUserID:onesignalUserID.mappingNSNullToNil];
450
+ }
451
+
448
452
  RCT_EXPORT_METHOD(setAirshipChannelID:(NSString *)airshipChannelID) {
449
453
  [RCCommonFunctionality setAirshipChannelID:airshipChannelID.mappingNSNullToNil];
450
454
  }
@@ -779,7 +783,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
779
783
  }
780
784
 
781
785
  - (NSString *)platformFlavorVersion {
782
- return @"10.6.0";
786
+ return @"10.7.0";
783
787
  }
784
788
 
785
789
  @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": "10.6.0",
4
+ "version": "10.7.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
  "module": "dist/index.js",
@@ -51,7 +51,7 @@
51
51
  "react-native-purchases-ui",
52
52
  "e2e-tests/MaestroTestApp"
53
53
  ],
54
- "packageManager": "yarn@3.6.1",
54
+ "packageManager": "yarn@3.6.1+sha512.de524adec81a6c3d7a26d936d439d2832e351cdfc5728f9d91f3fc85dd20b04391c038e9b4ecab11cae2b0dd9f0d55fd355af766bc5c1a7f8d25d96bb2a0b2ca",
55
55
  "repository": {
56
56
  "type": "git",
57
57
  "url": "git+https://github.com/revenuecat/react-native-purchases.git",
@@ -118,7 +118,7 @@
118
118
  ]
119
119
  },
120
120
  "dependencies": {
121
- "@revenuecat/purchases-js-hybrid-mappings": "18.28.0",
122
- "@revenuecat/purchases-typescript-internal": "18.28.0"
121
+ "@revenuecat/purchases-js-hybrid-mappings": "18.29.0",
122
+ "@revenuecat/purchases-typescript-internal": "18.29.0"
123
123
  }
124
124
  }