Skip to content

Commit

Permalink
Release 2.4.0-beta5.
Browse files Browse the repository at this point in the history
Attempt to fix #315.
  • Loading branch information
hyochan committed Dec 30, 2018
1 parent 4eb8ab9 commit 1584726
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions android/src/main/java/com/dooboolab/RNIap/RNIapModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public RNIapModule(ReactApplicationContext reactContext) {
}

private void ensureConnection (final Promise promise, final Runnable callback) {
if (mBillingClient != null) {
if (clientReady) {
callback.run();
return;
}
Expand All @@ -121,7 +121,7 @@ private void ensureConnection (final Promise promise, final Runnable callback) {
final BillingClientStateListener billingClientStateListener = new BillingClientStateListener() {
@Override
public void onBillingSetupFinished(@BillingClient.BillingResponse int responseCode) {
if (responseCode == BillingClient.BillingResponse.OK && !clientReady) {
if (responseCode == BillingClient.BillingResponse.OK ) {
Log.d(TAG, "billing client ready");
callback.run();
clientReady = true;
Expand All @@ -141,6 +141,7 @@ public void onBillingServiceDisconnected() {
reactContext.bindService(intent, mServiceConn, Context.BIND_AUTO_CREATE);
mBillingClient = BillingClient.newBuilder(reactContext).setListener(purchasesUpdatedListener).build();
mBillingClient.startConnection(billingClientStateListener);
clientReady = true;
} catch (Exception e) {
promise.reject(E_NOT_PREPARED, e.getMessage(), e);
}
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": "2.4.0-beta4",
"version": "2.4.0-beta5",
"description": "React Native In App Purchase Module.",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 1584726

Please sign in to comment.