Code Monkey home page Code Monkey logo

Comments (3)

zander-berg avatar zander-berg commented on September 13, 2024

Hey,

I also had quite a lot of those Exception. I figured out that many of them came from Google Play Store responses without a notificationId. If the response comes from a refunded or canceled purchase, the plugin won't know about bit and try to confirm a 'null' id. Here's my proposed fix which seems to get rid of some of these Exceptions:

In BillingController.java, function onPurchaseStateChanged you see the following (approx. line 422)

            if (p.notificationId != null && automaticConfirmations.contains(p.productId)) {
                confirmations.add(p.notificationId);
            } else {
                // TODO: Discriminate between purchases, cancellations and
                // refunds.
                addManualConfirmation(p.productId, p.notificationId);
            }

Replace by:

            if (p.notificationId != null && automaticConfirmations.contains(p.productId)) {
                confirmations.add(p.notificationId);
            } else {
                // TODO: Discriminate between purchases, cancellations and
                // refunds.
                if (p.notificationId != null) {
                    addManualConfirmation(p.productId, p.notificationId);
                }
            }

Hope that helps a little.

from androidbillinglibrary.

shah0664 avatar shah0664 commented on September 13, 2024

Hi,

That Replaced code works for u or not , as i am experiencing the same issue.

from androidbillinglibrary.

zander-berg avatar zander-berg commented on September 13, 2024

hey, sorry for the late response.

the replaced code above makes the code much more stable in my case. there are still very rare crashes of the billinglibrary, but the app has been released and in-app purchases are running fine without customer complaints.

from androidbillinglibrary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.