Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

enablePendingPurchases was deprecated in version 7 of the google billing library

When updating the Google Billing Library to version 7 it marks the enablePendingPurchases() method as obsolete.

Reading the documentation it seems we now need to pass a PendingPurchasesParams object as a parameter to the new enablePurchases() method.

Reading the documentation for PendingPurchasesParams it only has the newBuilder method so I don't know if I could simply use:

billingClient = BillingClient.newBuilder(Settings.this)
                    .setListener(purchasesUpdatedListener)
                    .enablePendingPurchases(PendingPurchasesParams.newBuilder().build())
                    .build();

Or how should I handle this situation?

like image 907
JP711 Avatar asked Dec 06 '25 08:12

JP711


1 Answers

If you want the same behavior as previously, use the following as stated in the Google Play Billing Library 7.0.0 release notes.

The deprecated enablePendingPurchases() is functionally equivalent to enablePendingPurchases(PendingPurchasesParams.newBuilder().enableOneTimeProducts().build()).

like image 174
Bona Fide Avatar answered Dec 07 '25 22:12

Bona Fide