Skip to content

Commit

Permalink
Resolve #788
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Oct 11, 2019
1 parent 1ed7cd1 commit 2c432af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## Changelogs
- **[4.0.5]**
- Resolve [#788](https://github.com/dooboolab/react-native-iap/issues/788)
- **[4.0.4]**
- Call correct methods in finishTransaction Android [#778](https://github.com/dooboolab/react-native-iap/pull/778)
- **[4.0.3]**
Expand Down
4 changes: 3 additions & 1 deletion android/src/main/java/com/dooboolab/RNIap/RNIapModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -546,14 +546,16 @@ private void sendUnconsumedPurchases(final Promise promise) {
public void run() {
Purchase.PurchasesResult purchasesResult = billingClient.queryPurchases(BillingClient.SkuType.INAPP);
ArrayList<Purchase> unacknowledgedPurchases = new ArrayList<>();
if (purchasesResult == null || purchasesResult.getPurchasesList() == null) {
if (purchasesResult == null || purchasesResult.getPurchasesList() == null || purchasesResult.getPurchasesList().size() == 0) {
promise.resolve(false);
return;
}
for (Purchase purchase : purchasesResult.getPurchasesList()) {
if (!purchase.isAcknowledged()) {
unacknowledgedPurchases.add(purchase);
}
}
promise.resolve(true);
onPurchasesUpdated(purchasesResult.getBillingResult(), unacknowledgedPurchases);
}
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-iap",
"version": "4.0.4",
"version": "4.0.5",
"description": "React Native In App Purchase Module.",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 2c432af

Please sign in to comment.