react-native-iap 7.4.1 → 7.5.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  ## Changelogs
2
2
 
3
+ # 7.5.0
4
+
5
+ ### Bugfix
6
+ - Fix canceled purchase dangling [#1504](https://github.com/dooboolab/react-native-iap/pull/1504)
7
+
8
+ ### Dependencies
9
+ - Set default `androidX` version [#1505](https://github.com/dooboolab/react-native-iap/pull/1505)
10
+ - Update packages [#1506](https://github.com/dooboolab/react-native-iap/pull/1506)
11
+
3
12
  # 7.4.1
4
13
 
5
14
  - [iOS] Add `quantityIOS` in purchase data [#1476](https://github.com/dooboolab/react-native-iap/pull/1476)
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![CI](https://github.com/dooboolab/react-native-iap/actions/workflows/ci.yml/badge.svg)](https://github.com/dooboolab/react-native-iap/actions/workflows/ci.yml)
7
7
  [![document](https://github.com/dooboolab/react-native-iap/actions/workflows/deploy-document.yml/badge.svg)](https://github.com/dooboolab/react-native-iap/actions/workflows/deploy-document.yml)
8
8
  [![License](https://img.shields.io/npm/l/react-native-iap.svg)](https://npmjs.org/package/react-native-iap)
9
- [![Vulnerabilites](https://img.shields.io/snyk/vulnerabilities/github/dooboolab/react-native-iap.svg)](https://github.com/dooboolab/react-native-iap)
9
+ [![Vulnerabilities](https://img.shields.io/snyk/vulnerabilities/github/dooboolab/react-native-iap.svg)](https://github.com/dooboolab/react-native-iap)
10
10
  [![Issue Opened](https://img.shields.io/opencollective/all/react-native-iap.svg)](https://opencollective.com/react-native-iap#backers)
11
11
  [![Issue Opened](https://img.shields.io/github/issues/dooboolab/react-native-iap.svg)](https://github.com/dooboolab/react-native-iap/issues)
12
12
  [![Issue Closed](https://img.shields.io/github/issues-closed/dooboolab/react-native-iap.svg)](https://github.com/dooboolab/react-native-iap/issues?q=is%3Aissue+is%3Aclosed)
@@ -90,13 +90,13 @@ Quick News
90
90
  - We had hard time supporting `react-native-iap` issues that did not provide working codes or any other examples. Therefore, we've decided to make an `example` app called [DoobooIAP](https://github.com/hyochan/DoobooIAP), which will contain all the features of `IAP`'s and willing to continuously improve to support real-life examples. [@Bang9](http://github.com/bang9) who had been helping many others for `react-native-iap`, is willing to support this repo so he will grant $300 of our income in `opencollective` as described in [#855](https://github.com/dooboolab/react-native-iap/issues/855) :tada:.
91
91
  - `react-native-iap@4.0.8` ~ `react-native-iap@4.1.0` is incompatible with `react-native <0.61`. This is fixed in `react-native-iap@4.1.1` and above.
92
92
  - `react-native-iap@4.0.0` has been released. You can see [#716](https://github.com/dooboolab/react-native-iap/pull/716) for updates.
93
- - In the past, `react-native-iap@^3.*` has been updated very prompty for migration issues.
94
- Don't get suprised too much on why it is bumping up version so quickly these days.
93
+ - In the past, `react-native-iap@^3.*` has been updated very promptly for migration issues.
94
+ Don't get surprised too much on why it is bumping up version so quickly these days.
95
95
  1. Migrated to new `AndroidX` APIs.
96
96
  2. Migrated to new `Android` billing client which is `> 2.0.0`.
97
97
  - [`acknowledgePurchase()`][android-acknowledge-purchase] has been added since `3.2.0` which is very important.
98
98
  3. New [Purchase Flow][a-purchase-flow]
99
- 4. More is comming in `iOS 13`.
99
+ 4. More is coming in `iOS 13`.
100
100
 
101
101
  Breaking Changes
102
102
  ----------------
@@ -71,7 +71,7 @@ dependencies {
71
71
  implementation "com.android.support:support-annotations:$supportLibVersion"
72
72
  implementation "com.android.support:customtabs:$supportLibVersion"
73
73
  } else {
74
- def defaultAndroidXVersion = "1.+"
74
+ def defaultAndroidXVersion = "1.2.0"
75
75
  if (androidXVersion == null) {
76
76
  androidXVersion = defaultAndroidXVersion
77
77
  }
@@ -583,9 +583,7 @@ public class RNIapModule extends ReactContextBaseJavaModule implements Purchases
583
583
  error.putString("message", errorData[1]);
584
584
  sendEvent(reactContext, "purchase-error", error);
585
585
 
586
- if (responseCode != BillingClient.BillingResponseCode.USER_CANCELED) {
587
- PlayUtils.getInstance().rejectPromisesWithBillingError(PROMISE_BUY_ITEM, responseCode);
588
- }
586
+ PlayUtils.getInstance().rejectPromisesWithBillingError(PROMISE_BUY_ITEM, responseCode);
589
587
  return;
590
588
  }
591
589
 
package/ios/RNIapIos.m CHANGED
@@ -463,11 +463,9 @@ RCT_EXPORT_METHOD(presentCodeRedemptionSheet:(RCTPromiseResolveBlock)resolve
463
463
  [self sendEventWithName:@"purchase-error" body:err];
464
464
  }
465
465
 
466
- if (transaction.error.code != SKErrorPaymentCancelled) {
467
- [self rejectPromisesForKey:transaction.payment.productIdentifier code:[self standardErrorCode:(int)transaction.error.code]
468
- message:transaction.error.localizedDescription
469
- error:transaction.error];
470
- }
466
+ [self rejectPromisesForKey:transaction.payment.productIdentifier code:[self standardErrorCode:(int)transaction.error.code]
467
+ message:transaction.error.localizedDescription
468
+ error:transaction.error];
471
469
  });
472
470
  break;
473
471
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-iap",
3
- "version": "7.4.1",
3
+ "version": "7.5.0",
4
4
  "description": "React Native In App Purchase Module.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -43,31 +43,31 @@
43
43
  "dooboolab-welcome": "1.3.2"
44
44
  },
45
45
  "devDependencies": {
46
- "@babel/core": "7.14.8",
46
+ "@babel/core": "7.15.5",
47
47
  "@babel/plugin-proposal-class-properties": "7.14.5",
48
48
  "@babel/plugin-proposal-private-methods": "7.14.5",
49
- "@babel/preset-env": "7.14.8",
49
+ "@babel/preset-env": "7.15.6",
50
50
  "@babel/preset-react": "7.14.5",
51
- "@babel/preset-typescript": "7.14.5",
52
- "@dooboo/eslint-config": "0.8.2",
53
- "@testing-library/jest-native": "4.0.1",
51
+ "@babel/preset-typescript": "7.15.0",
52
+ "@dooboo/eslint-config": "0.8.5",
53
+ "@testing-library/jest-native": "4.0.2",
54
54
  "@testing-library/react-native": "7.2.0",
55
55
  "@types/eslint": "7.28.0",
56
- "@types/jest": "26.0.24",
57
- "@types/react": "17.0.15",
58
- "@types/react-native": "0.64.12",
56
+ "@types/jest": "27.0.1",
57
+ "@types/react": "17.0.21",
58
+ "@types/react-native": "0.65.0",
59
59
  "babel-core": "7.0.0-bridge.0",
60
60
  "babel-eslint": "10.1.0",
61
- "babel-jest": "27.0.6",
62
- "eslint": "7.31.0",
63
- "flow-bin": "0.156.0",
61
+ "babel-jest": "27.2.0",
62
+ "eslint": "7.32.0",
63
+ "flow-bin": "0.160.0",
64
64
  "flowgen": "1.14.1",
65
- "jest": "27.0.6",
65
+ "jest": "27.2.0",
66
66
  "metro-react-native-babel-preset": "0.66.2",
67
- "monolinter": "1.0.2",
68
- "prettier": "2.3.2",
67
+ "monolinter": "1.0.4",
68
+ "prettier": "2.4.1",
69
69
  "react-native": "0.64.2",
70
- "ts-jest": "27.0.4",
71
- "typescript": "4.3.5"
70
+ "ts-jest": "27.0.5",
71
+ "typescript": "4.4.3"
72
72
  }
73
73
  }
@@ -34,10 +34,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
34
34
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
35
  }
36
36
  };
37
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
38
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
39
- to[j] = from[i];
40
- return to;
37
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
38
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
39
+ if (ar || !(i in from)) {
40
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
41
+ ar[i] = from[i];
42
+ }
43
+ }
44
+ return to.concat(ar || Array.prototype.slice.call(from));
41
45
  };
42
46
  import React, { useContext, useEffect, useMemo, useState } from 'react';
43
47
  import { NativeEventEmitter, NativeModules } from 'react-native';
@@ -118,7 +122,7 @@ export function withIAPContext(Component) {
118
122
  case 0: return [4 /*yield*/, getPromotedProductIOS()];
119
123
  case 1:
120
124
  product = _a.sent();
121
- setPromotedProductsIOS(function (prevProducts) { return __spreadArray(__spreadArray([], prevProducts), (product ? [product] : [])); });
125
+ setPromotedProductsIOS(function (prevProducts) { return __spreadArray(__spreadArray([], prevProducts, true), (product ? [product] : []), true); });
122
126
  return [2 /*return*/];
123
127
  }
124
128
  });