Skip to content

Commit

Permalink
Release 4.0.3
Browse files Browse the repository at this point in the history
* Resolve #771
  • Loading branch information
hyochan authored Oct 8, 2019
1 parent 7b4050b commit 6eabb38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions android/src/main/java/com/dooboolab/RNIap/RNIapModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ public void onPurchasesUpdated(BillingResult billingResult, @Nullable List<Purch
}

if (purchases != null) {
WritableMap promiseItem = null;
for (Purchase purchase : purchases) {
WritableMap item = Arguments.createMap();
item.putString("productId", purchase.getSku());
Expand All @@ -522,9 +523,10 @@ public void onPurchasesUpdated(BillingResult billingResult, @Nullable List<Purch
item.putInt("purchaseStateAndroid", purchase.getPurchaseState());

sendEvent(reactContext, "purchase-updated", item);
promiseItem = item;
}
if (purchases.size() > 0) {
DoobooUtils.getInstance().resolvePromisesForKey(PROMISE_BUY_ITEM, purchases.get(0));
if (purchases.size() > 0 && promiseItem != null) {
DoobooUtils.getInstance().resolvePromisesForKey(PROMISE_BUY_ITEM, promiseItem);
}
} else {
WritableMap error = Arguments.createMap();
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.2",
"version": "4.0.3",
"description": "React Native In App Purchase Module.",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 6eabb38

Please sign in to comment.