react-native-purchases 10.8.1 → 10.9.1

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.33.1'
28
+ spec.dependency "PurchasesHybridCommon", '18.37.0'
29
29
  spec.swift_version = '5.7'
30
30
  end
@@ -12,7 +12,13 @@ buildscript {
12
12
  }
13
13
 
14
14
  apply plugin: 'com.android.library'
15
- apply plugin: 'kotlin-android'
15
+ // AGP 9 ships built-in Kotlin support and registers the `kotlin` extension
16
+ // itself. Applying kotlin-android on top of it fails with
17
+ // "Cannot add extension with name 'kotlin'". Only apply it when nothing
18
+ // has registered that extension yet.
19
+ if (project.extensions.findByName('kotlin') == null) {
20
+ apply plugin: 'kotlin-android'
21
+ }
16
22
 
17
23
  def getExtOrDefault(name) {
18
24
  return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['Purchases_' + name]
@@ -29,7 +35,7 @@ android {
29
35
  minSdkVersion getExtOrIntegerDefault('minSdkVersion')
30
36
  targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
31
37
  versionCode 1
32
- versionName '10.8.1'
38
+ versionName '10.9.1'
33
39
  }
34
40
 
35
41
  buildTypes {
@@ -121,6 +127,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
121
127
  dependencies {
122
128
  //noinspection GradleDynamicVersion
123
129
  api 'com.facebook.react:react-native:+'
124
- implementation 'com.revenuecat.purchases:purchases-hybrid-common:18.33.1'
130
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:18.37.0'
125
131
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
126
132
  }
@@ -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.8.1";
54
+ public static final String PLUGIN_VERSION = "10.9.1";
55
55
 
56
56
  private final ReactApplicationContext reactContext;
57
57
 
@@ -501,6 +501,11 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
501
501
  SubscriberAttributesKt.setKochavaDeviceID(kochavaDeviceID);
502
502
  }
503
503
 
504
+ @ReactMethod
505
+ public void setSingularDeviceID(String singularDeviceID) {
506
+ SubscriberAttributesKt.setSingularDeviceID(singularDeviceID);
507
+ }
508
+
504
509
  @ReactMethod
505
510
  public void setOnesignalID(String onesignalID) {
506
511
  SubscriberAttributesKt.setOnesignalID(onesignalID);
@@ -63,6 +63,7 @@ export declare const browserNativeModuleRNPurchases: {
63
63
  setFirebaseAppInstanceID: (_firebaseAppInstanceID: string) => Promise<void>;
64
64
  setTenjinAnalyticsInstallationID: (_tenjinAnalyticsInstallationID: string) => Promise<void>;
65
65
  setKochavaDeviceID: (_kochavaDeviceID: string) => Promise<void>;
66
+ setSingularDeviceID: (_singularDeviceID: string) => Promise<void>;
66
67
  setOnesignalID: (_onesignalID: string) => Promise<void>;
67
68
  setOnesignalUserID: (_onesignalUserID: string) => Promise<void>;
68
69
  setAirshipChannelID: (_airshipChannelID: string) => Promise<void>;
@@ -43,7 +43,7 @@ var typeGuards_1 = require("./typeGuards");
43
43
  var environment_1 = require("../utils/environment");
44
44
  var utils_1 = require("./utils");
45
45
  var purchaseSimulatedPackageHelper_1 = require("./simulatedstore/purchaseSimulatedPackageHelper");
46
- var packageVersion = '10.8.1';
46
+ var packageVersion = '10.9.1';
47
47
  /**
48
48
  * Browser implementation of the native module. This will be used in the browser and Expo Go.
49
49
  */
@@ -457,6 +457,12 @@ exports.browserNativeModuleRNPurchases = {
457
457
  return [2 /*return*/];
458
458
  });
459
459
  }); },
460
+ setSingularDeviceID: function (_singularDeviceID) { return __awaiter(void 0, void 0, void 0, function () {
461
+ return __generator(this, function (_a) {
462
+ (0, utils_1.methodNotSupportedOnWeb)('setSingularDeviceID');
463
+ return [2 /*return*/];
464
+ });
465
+ }); },
460
466
  setOnesignalID: function (_onesignalID) { return __awaiter(void 0, void 0, void 0, function () {
461
467
  return __generator(this, function (_a) {
462
468
  (0, utils_1.methodNotSupportedOnWeb)('setOnesignalID');
@@ -829,6 +829,19 @@ export default class Purchases {
829
829
  * setting the Kochava Device ID.
830
830
  */
831
831
  static setKochavaDeviceID(kochavaDeviceID: string | null): Promise<void>;
832
+ /**
833
+ * Subscriber attribute associated with the Singular Device ID (SDID) for the user.
834
+ * Required for the RevenueCat Singular integration when using Singular's Event
835
+ * Endpoint V2.
836
+ *
837
+ * The SDID is generated by the Singular SDK and cannot be collected by
838
+ * collectDeviceIdentifiers, so it has to be forwarded by the app.
839
+ *
840
+ * @param singularDeviceID Singular device ID to use in the Singular integration. Empty String or null will delete the subscriber attribute.
841
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
842
+ * setting the Singular Device ID.
843
+ */
844
+ static setSingularDeviceID(singularDeviceID: string | null): Promise<void>;
832
845
  /**
833
846
  * Subscriber attribute associated with the OneSignal Player Id for the user
834
847
  * Required for the RevenueCat OneSignal integration with OneSignal SDK v4.0 and below
package/dist/purchases.js CHANGED
@@ -1546,6 +1546,31 @@ var Purchases = /** @class */ (function () {
1546
1546
  });
1547
1547
  });
1548
1548
  };
1549
+ /**
1550
+ * Subscriber attribute associated with the Singular Device ID (SDID) for the user.
1551
+ * Required for the RevenueCat Singular integration when using Singular's Event
1552
+ * Endpoint V2.
1553
+ *
1554
+ * The SDID is generated by the Singular SDK and cannot be collected by
1555
+ * collectDeviceIdentifiers, so it has to be forwarded by the app.
1556
+ *
1557
+ * @param singularDeviceID Singular device ID to use in the Singular integration. Empty String or null will delete the subscriber attribute.
1558
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
1559
+ * setting the Singular Device ID.
1560
+ */
1561
+ Purchases.setSingularDeviceID = function (singularDeviceID) {
1562
+ return __awaiter(this, void 0, void 0, function () {
1563
+ return __generator(this, function (_a) {
1564
+ switch (_a.label) {
1565
+ case 0: return [4 /*yield*/, throwIfNotConfigured()];
1566
+ case 1:
1567
+ _a.sent();
1568
+ RNPurchases.setSingularDeviceID(singularDeviceID);
1569
+ return [2 /*return*/];
1570
+ }
1571
+ });
1572
+ });
1573
+ };
1549
1574
  /**
1550
1575
  * Subscriber attribute associated with the OneSignal Player Id for the user
1551
1576
  * Required for the RevenueCat OneSignal integration with OneSignal SDK v4.0 and below
package/ios/RNPurchases.m CHANGED
@@ -441,6 +441,10 @@ RCT_EXPORT_METHOD(setKochavaDeviceID:(NSString *)kochavaDeviceID) {
441
441
  [RCCommonFunctionality setKochavaDeviceID:kochavaDeviceID.mappingNSNullToNil];
442
442
  }
443
443
 
444
+ RCT_EXPORT_METHOD(setSingularDeviceID:(NSString *)singularDeviceID) {
445
+ [RCCommonFunctionality setSingularDeviceID:singularDeviceID.mappingNSNullToNil];
446
+ }
447
+
444
448
  RCT_EXPORT_METHOD(setOnesignalID:(NSString *)onesignalID) {
445
449
  [RCCommonFunctionality setOnesignalID:onesignalID.mappingNSNullToNil];
446
450
  }
@@ -785,7 +789,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
785
789
  }
786
790
 
787
791
  - (NSString *)platformFlavorVersion {
788
- return @"10.8.1";
792
+ return @"10.9.1";
789
793
  }
790
794
 
791
795
  @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.8.1",
4
+ "version": "10.9.1",
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",
@@ -118,7 +118,7 @@
118
118
  ]
119
119
  },
120
120
  "dependencies": {
121
- "@revenuecat/purchases-js-hybrid-mappings": "18.33.1",
122
- "@revenuecat/purchases-typescript-internal": "18.33.1"
121
+ "@revenuecat/purchases-js-hybrid-mappings": "18.37.0",
122
+ "@revenuecat/purchases-typescript-internal": "18.37.0"
123
123
  }
124
124
  }