Search code examples
in-app-billingandroid-billingplay-billing-library

Open this app to confirm your subscription before Jun 23, 2020


Open this app to confirm your subscription before Jun 23, 2020. What is causing this?


Solution

  • PurchaseResult was returning my purchases with acknowledge as false. Using the following code, managed to fix the issue.

    for (Purchase purchase: purchasesResult.getPurchasesList()) {
                    AcknowledgePurchaseParams acknowledgePurchaseParams =
                            AcknowledgePurchaseParams.newBuilder()
                                    .setPurchaseToken(purchase.getPurchaseToken())
                                    .build();
                    acknowledgePurchaseParams.getDeveloperPayload();
    
                    AcknowledgePurchaseResponseListener acknowledgePurchaseResponseListener = new AcknowledgePurchaseResponseListener() {
                        @Override
                        public void onAcknowledgePurchaseResponse(BillingResult billingResult) {
                            BillingResult billingResult1 = billingResult;
                        }
    
                    };
    
                    mBillingClient.acknowledgePurchase(acknowledgePurchaseParams, acknowledgePurchaseResponseListener);
                }