react-native-purchases 8.7.0 → 8.8.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", '13.21.0'
28
+ spec.dependency "PurchasesHybridCommon", '13.25.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 '8.7.0'
32
+ versionName '8.8.1'
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:13.21.0'
124
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:13.25.0'
125
125
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
126
126
  }
@@ -47,7 +47,7 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
47
47
  private static final String CUSTOMER_INFO_UPDATED = "Purchases-CustomerInfoUpdated";
48
48
  private static final String LOG_HANDLER_EVENT = "Purchases-LogHandlerEvent";
49
49
  public static final String PLATFORM_NAME = "react-native";
50
- public static final String PLUGIN_VERSION = "8.7.0";
50
+ public static final String PLUGIN_VERSION = "8.8.1";
51
51
 
52
52
  private final ReactApplicationContext reactContext;
53
53
 
@@ -746,6 +746,10 @@ export default class Purchases {
746
746
  * refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED
747
747
  */
748
748
  static beginRefundRequestForProduct(storeProduct: PurchasesStoreProduct): Promise<REFUND_REQUEST_STATUS>;
749
+ /**
750
+ * Presents the App Store sheet for managing subscriptions. Only available in iOS 13+ devices.
751
+ */
752
+ static showManageSubscriptions(): Promise<void>;
749
753
  /**
750
754
  * Shows in-app messages available from the App Store or Google Play. You need to disable messages from showing
751
755
  * automatically using [PurchasesConfiguration.shouldShowInAppMessagesAutomatically].
package/dist/purchases.js CHANGED
@@ -1571,6 +1571,24 @@ var Purchases = /** @class */ (function () {
1571
1571
  });
1572
1572
  });
1573
1573
  };
1574
+ /**
1575
+ * Presents the App Store sheet for managing subscriptions. Only available in iOS 13+ devices.
1576
+ */
1577
+ Purchases.showManageSubscriptions = function () {
1578
+ return __awaiter(this, void 0, void 0, function () {
1579
+ return __generator(this, function (_a) {
1580
+ switch (_a.label) {
1581
+ case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
1582
+ case 1:
1583
+ _a.sent();
1584
+ return [4 /*yield*/, Purchases.throwIfAndroidPlatform()];
1585
+ case 2:
1586
+ _a.sent();
1587
+ return [2 /*return*/, RNPurchases.showManageSubscriptions()];
1588
+ }
1589
+ });
1590
+ });
1591
+ };
1574
1592
  /**
1575
1593
  * Shows in-app messages available from the App Store or Google Play. You need to disable messages from showing
1576
1594
  * automatically using [PurchasesConfiguration.shouldShowInAppMessagesAutomatically].
package/ios/RNPurchases.m CHANGED
@@ -467,6 +467,34 @@ RCT_EXPORT_METHOD(beginRefundRequestForProductId:(NSString *)productIdentifier
467
467
  #endif
468
468
  }
469
469
 
470
+ RCT_EXPORT_METHOD(showManageSubscriptions:
471
+ (RCTPromiseResolveBlock)resolve
472
+ reject:(RCTPromiseRejectBlock)reject) {
473
+ #if TARGET_OS_IPHONE && !TARGET_OS_TV
474
+ if (@available(iOS 13.0, macOS 10.15, visionOS 1.0, *)) {
475
+ [RCCommonFunctionality showManageSubscriptions:^(RCErrorContainer * _Nullable errorContainer) {
476
+ if (errorContainer) {
477
+ reject(
478
+ [NSString stringWithFormat:@"%ld", (long)errorContainer.code],
479
+ errorContainer.message,
480
+ errorContainer.error
481
+ );
482
+ } else {
483
+ resolve(nil);
484
+ }
485
+ }];
486
+ } else {
487
+ NSLog(@"[Purchases] Warning: tried to showManageSubscriptions in non supported iOS devices. Only available on iOS 13.0 or greater.");
488
+ NSError *error = [self createUnsupportedErrorWithDescription:@"Tried to present manage subscriptions sheet, but this functionality is only available on iOS 13.0 or greater."];
489
+ reject([NSString stringWithFormat:@"%ld", (long)error.code], [error localizedDescription], error);
490
+ }
491
+ #else
492
+ NSLog(@"[Purchases] Warning: tried to showManageSubscriptions in non-ios devices. That's not supported.");
493
+ NSError *error = [self createUnsupportedErrorWithDescription:@"Tried to present manage subscriptions sheet, but this functionality is only available on iOS devices."];
494
+ reject([NSString stringWithFormat:@"%ld", (long)error.code], [error localizedDescription], error);
495
+ #endif
496
+ }
497
+
470
498
  RCT_EXPORT_METHOD(showInAppMessages:(NSArray<NSNumber *> *)messageTypes
471
499
  resolve:(RCTPromiseResolveBlock)resolve
472
500
  reject:(RCTPromiseRejectBlock)reject) {
@@ -595,7 +623,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
595
623
  }
596
624
 
597
625
  - (NSString *)platformFlavorVersion {
598
- return @"8.7.0";
626
+ return @"8.8.1";
599
627
  }
600
628
 
601
629
  @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": "8.7.0",
4
+ "version": "8.8.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
  "types": "dist/index.d.ts",
@@ -100,6 +100,6 @@
100
100
  ]
101
101
  },
102
102
  "dependencies": {
103
- "@revenuecat/purchases-typescript-internal": "13.21.0"
103
+ "@revenuecat/purchases-typescript-internal": "13.25.0"
104
104
  }
105
105
  }