react-native-purchases 4.4.0 → 4.5.2

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.
package/ios/RNPurchases.h CHANGED
@@ -3,11 +3,7 @@
3
3
  // Copyright © 2019 RevenueCat. All rights reserved.
4
4
  //
5
5
 
6
- #if __has_include("RCTEventEmitter.h")
7
- #import "RCTEventEmitter.h"
8
- #else
9
6
  #import <React/RCTEventEmitter.h>
10
- #endif
11
7
 
12
8
  #import <Purchases/RCPurchases.h>
13
9
  #import <PurchasesHybridCommon/PurchasesHybridCommon.h>
package/ios/RNPurchases.m CHANGED
@@ -41,7 +41,8 @@ RCT_EXPORT_METHOD(setupPurchases:(NSString *)apiKey
41
41
  observerMode:observerMode
42
42
  userDefaultsSuiteName:userDefaultsSuiteName
43
43
  platformFlavor:self.platformFlavor
44
- platformFlavorVersion:self.platformFlavorVersion];
44
+ platformFlavorVersion:self.platformFlavorVersion
45
+ dangerousSettings:nil];
45
46
  RCPurchases.sharedPurchases.delegate = self;
46
47
  [RCCommonFunctionality configure];
47
48
  }
@@ -320,6 +321,12 @@ RCT_REMAP_METHOD(canMakePayments,
320
321
  resolve(@([RCCommonFunctionality canMakePaymentsWithFeatures:features]));
321
322
  }
322
323
 
324
+ RCT_REMAP_METHOD(isConfigured,
325
+ isConfiguredWithResolve:(RCTPromiseResolveBlock)resolve
326
+ reject:(RCTPromiseRejectBlock)reject) {
327
+ resolve(@(RCPurchases.isConfigured));
328
+ }
329
+
323
330
  #pragma mark -
324
331
  #pragma mark Delegate Methods
325
332
  - (void)purchases:(RCPurchases *)purchases didReceiveUpdatedPurchaserInfo:(RCPurchaserInfo *)purchaserInfo {
@@ -362,7 +369,7 @@ shouldPurchasePromoProduct:(SKProduct *)product
362
369
  }
363
370
 
364
371
  - (NSString *)platformFlavorVersion {
365
- return @"4.4.0";
372
+ return @"4.5.2";
366
373
  }
367
374
 
368
375
  @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": "4.4.0",
4
+ "version": "4.5.2",
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",
@@ -34,8 +34,8 @@
34
34
  "test": "jest",
35
35
  "tslint": "tslint -c tslint.json 'src/*.ts'",
36
36
  "prepublish": "tsc",
37
- "example": "yarn --cwd examples/purchaseTester",
38
- "pods": "cd examples/purchaseTester && pod-install --quiet",
37
+ "example": "(yarn --cwd examples/purchaseTester) && (yarn --cwd examples/purchaseTesterTypescript)",
38
+ "pods": "(cd examples/purchaseTester && npx pod-install --quiet) && (cd examples/purchaseTesterTypescript && npx pod-install --quiet)",
39
39
  "bootstrap": "yarn example && yarn && yarn pods"
40
40
  },
41
41
  "repository": {
package/scripts/build.js CHANGED
@@ -5,11 +5,11 @@ if (os.type() === "Linux") {
5
5
  console.log("Skipping iOS Dependencies");
6
6
  } else if (os.type() === "Darwin") {
7
7
  const downloadProcess = exec(
8
- "./scripts/download-purchases-framework.sh 3.13.0"
8
+ "./scripts/download-purchases-framework.sh 3.14.1"
9
9
  );
10
10
  downloadProcess.stdout.pipe(process.stdout);
11
11
  const downloadProcessCommon = exec(
12
- "./scripts/download-purchases-common.sh 1.10.0"
12
+ "./scripts/download-purchases-common.sh 1.11.1"
13
13
  );
14
14
  downloadProcessCommon.stdout.pipe(process.stdout);
15
15
  } else if (os.type() === "Windows_NT") {
@@ -0,0 +1,19 @@
1
+ const {exec} = require("child_process");
2
+ const os = require("os");
3
+
4
+ if (os.type() === "Linux") {
5
+ console.log("Skipping iOS Dependencies");
6
+ } else if (os.type() === "Darwin") {
7
+ const downloadProcess = exec(
8
+ "./scripts/download-purchases-framework.sh 3.14.1"
9
+ );
10
+ downloadProcess.stdout.pipe(process.stdout);
11
+ const downloadProcessCommon = exec(
12
+ "./scripts/download-purchases-common.sh 1.11.1"
13
+ );
14
+ downloadProcessCommon.stdout.pipe(process.stdout);
15
+ } else if (os.type() === "Windows_NT") {
16
+ console.log("Skipping iOS Dependencies");
17
+ } else {
18
+ throw new Error(`Unsupported OS found: ${os.type()}`);
19
+ }
@@ -703,7 +703,8 @@ NativeModules.RNPurchases = {
703
703
  setPhoneNumber: jest.fn(),
704
704
  setDisplayName: jest.fn(),
705
705
  setPushToken: jest.fn(),
706
- canMakePayments: jest.fn()
706
+ canMakePayments: jest.fn(),
707
+ isConfigured: jest.fn()
707
708
  };
708
709
 
709
710
  jest.mock(