简体   繁体   中英

Android In-App Billing. Cancelled subscription is active even after expiration date

When testing subscriptions, it turned out that canceled subscriptions remain active even after their expiration date. At the same time in Google Play subscription list is empty. I tried two popular IAB libs (in-app-billing v3 and android-checkout).

What causes the problem? Is the problem relevant only when testing? Is there a way to check if the subscription is truly active without the need of running own backend?

bp = new BillingProcessor(a,
            "xxx",
            new BillingProcessor.IBillingHandler() {
            ...
                @Override
                public void onBillingInitialized() {
                    bp.loadOwnedPurchasesFromGoogle();
                    bp.isSubscribed(planId); // true for expired cancelled subscription that is not listed in google play
                }
            });

UPD

I implemented in-app billing without external libs by official guidelines ( https://developer.android.com/google/play/billing/billing_integrate.html ) and now it works as intended although i have to wait some time to cancelled expired subscription become inactive (sometimes an hour, sometimes a day).

you may try this one.

purchase.getPurchaseState()
// 0 (purchased), 1 (canceled)- 2 (refunded).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM