Giter VIP home page Giter VIP logo

cordova-plugin-inapppurchases's People

Contributors

cozycodegh avatar slenz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cordova-plugin-inapppurchases's Issues

Error message formatting

Would it be possible to improve the error message formatting?

Currently it looks like this:

{"code":-4,
 "message":"UNKNOWN_ERROR InAppBilling Error",
 "iabText": "Billing response error: A user billing error occurred during processing. Google Play In-app Billing API version is less than 3Error checking for billing v5 support.",
 "responseCode":3,
 "iabCode":-4}

I'd like to show to the end user what the error is.

E.g. both iabText and message seem to consist of two or more concatenated strings (e.g. "Billing response error: A user billing error occurred during processing. Google Play In-app Billing API version is less than 3" and "Error checking for billing v5 support."). Is it possible to keep them separate in the error response?

Feature request: handle subscription offers

Google play has the option to add subscription offers (e.g. 7 day free trial). But I didn't find a way to handle this in the implementation of this package.
Are there any plans to add it?

Example:

I have a base plan setup that runs for 2.39€ / month and a 7 day trial offer:

image

I'm able to subscribe to this, however, I can't fetch the price of the base plan. Instead, I get a 0 cost reply from getAllProductInfo:

image

Allow Android App to upgrade or downgrade

Hello, thank you for this plugin.
I have been working on a cordova app for several years now and am trying to test and then promote my app on the play store. I would like to allow my user to upgrade or downgrade through the three subscriptions I offer. Android implements upgrades and downgrades differently form App Store Connect. Android developer information offers this suggestion to implement upgrade and downgrade. Unfortunately my Java ability is pretty low, so I'm not sure how to execute those directions. I can see "BillingFlowParams billingFlowParams" in the IabHelper.java file, line 645, in the launchBillingFlowAsync method which is used in the InAppBilling.java file, lines 483 and 492, eventually going back to the purchase method on line 593 in the same file. You would need to pass back the old and new subscriptions and the replacement mode indicating any change in the billing and access because of the upgrade or downgrade in the inAppPurchase.purchase() method.
I have looked through the code, forks, and pull requests and don't see any indication that this has been addressed so please let me know if this has already been implemented.
Thanks in advance,
Marjika

Inconsistent response from getAllProductInfo

When requesting product info for subscriptions I'm getting an inconsistent response (see screenshots below). I've noticed this issue in the older packages (cordova-plugin-inapppurchase without the "s") as well. Maybe some response caching is going on?

image

and

image

Ios buy inApp and close App

I am using the latest version of the plugin, but I am having an error when trying to make some strange use case, the problem I am having is that when I buy an InApp, the purchase window appears, but before the purchase message appears confirmed I close the app, with the app closed I see that the confirmed purchase window appears, I open the app again, and I do not see any log referring to that purchase, I execute restorePurchases and it returns an empty object, and if I try to buy the same article, Apple tells me that I already have this article, but the plugin does not give me an error at this point and should give me an error that I already have the article so I can consume it.
Thanks for the plugin.

Purchase.completed is true when it shouldnt

First of all, thanks for this plugin!

I noticed odd behavior of my app after I upgraded this plugin from 2.4.8 to 3.0.2. Going through the commits, I noticed this line:

completed: res.pending == 0,

at 0bc203c#diff-f03cc1bc99555771d580b62c075ca39d17dffbdd8498c73b84d584c1ca83feebR245

Every purchase I make in my app is now flagged 'completed', even though in fact they're not (once a purchase is successful, it needs to be completed manually to unlock the product in case of a consumable).

All in all, I think that line should be:

completed: res.completed == 1,

NullPointerException

First of all thanks for coding up this lib. It's the only working one that I could find after a lot of digging. 🙏

Possibly the same issue that was fixed here? RainerAppel/cordova-plugin-inapppurchase@master...richmoh:cordova-plugin-inapppurchase:master

Stack trace:

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{<packagename>/com.android.billingclient.api.ProxyBillingActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.IntentSender android.app.PendingIntent.getIntentSender()' on a null object reference
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
       at android.app.ActivityThread.-wrap11(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6494)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.IntentSender android.app.PendingIntent.getIntentSender()' on a null object reference
       at com.android.billingclient.api.ProxyBillingActivity.onCreate(ProxyBillingActivity.java:121)
       at android.app.Activity.performCreate(Activity.java:7009)
       at android.app.Activity.performCreate(Activity.java:7000)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
       at android.app.ActivityThread.-wrap11(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6494)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Here's the raw stacktrace from crashlytics: stacktrace.txt

Screenshot 2023-02-08 at 10 16 28

Consumable product does not finish

Greetings.
Could you help me with the problem I'm facing?
I am unable to consume the product, so it is not available for new purchase.
Here's the code:

                function buyPaidContent() {

                    var product_id_1 = localStorage.getItem("product_id_1");

                    inAppPurchases.purchase(product_id_1).then(function (purchase) {
                        if (purchase["pending"]) {
                            //            alert("waiting for payment to complete");
                            return; //not paid for yet
                        }

                        var creditos_app = localStorage.getItem("creditos_app");
                        creditos_app = parseInt(creditos_app)
                        var product_id_1 = localStorage.getItem("product_id_1");

                        return inAppPurchases.completePurchase(product_id_1);

                    }).then(function (purchase) {
                        app.views.main.router.navigate('/home/');
                    }).catch(function (err) {
                        alert("Assinatura não efetuada");
                        alert(JSON.stringify(err));
                        logError(err);
                    });

Thank you friends

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.