[Android] acknowledgePurchaseAndroid() Google is indicating that we have some issue connecting to payment.

See original GitHub issue

Version of react-native-iap > 3.4.12

Version of react-native > 0.58.3

Platforms you faced the error > Android

Actual behavior

I have got a Google is indicating that we have some issue connecting to payment. error In logcat I get a E/DoobooUtils: Error Code : 5

I was using version 2.5.5 previously, it was working fine. The only thing not working there is the acknowledgePurchaseAndroid call

Tested environment > Real Device

Here is my code :

  handleServerSubscribe = async purchase => {
    const {
      productId,
      transactionReceipt,
    } = purchase
    if (transactionReceipt) {
      try {
          // FIXME it fails right here
          await acknowledgePurchaseAndroid(purchase.purchaseToken)

      } catch (e) {
        console.log('subscription error ', e)
      }
    }
  }


componentDidMount() {
    this.purchaseUpdateSubscription = purchaseUpdatedListener(purchase => {
      this.handleServerSubscribe(purchase)
    })
  }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:35 (7 by maintainers)

github_iconTop GitHub Comments

10reactions
compellingcommented, Sep 24, 2020

I got it working: I just made these specific lines for Android, but the need to do so was not very apparent from the documentation. Now it works both on Android and iOS: // on Android we need to acknowledge purchase or finishTransaction fails // if we do not acknowledge, purchase will roll back in 5 min RNIap.acknowledgePurchaseAndroid(purchase.purchaseToken).then(() => { RNIap.finishTransaction(purchase, true).catch(err => { console.log(err.code, err.message); }); });

3reactions
creativemind1commented, May 1, 2020

I’m getting the same error with RNIap.finishTransaction

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Google is indicating that we have some issue ...
Error : Google is indicating that we have some issue connecting to payment. #1501 ... I checked all issues related to this issue,...
Read more >
Is it normal to get this error while testing in app purchases for ...
I am not sure if this appears only in test iap and will be solved when using real purchases. the iap code is:...
Read more >
flutter_inapp_purchase | Flutter Package - Pub.dev
End billing connection. consumeAllItems, String, Manually consume all items in android. Do NOT call if you have any non-consumables (one time purchase ...
Read more >
react-native-iap - npm
Acknowledge a purchase when you have delivered it to your user by calling acknowledgePurchaseAndroid() . On iOS non-consumable purchases are ...
Read more >
BillingClient.BillingResponseCode - Android Developers
A user billing error occurred during processing. ... The app is not connected to the Play Store service via the Google Play Billing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found