Reputation: 695
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?
Upvotes: 11
Views: 2763
Reputation: 1067
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 toenablePendingPurchases(PendingPurchasesParams.newBuilder().enableOneTimeProducts().build())
.
Upvotes: 34
Reputation: 41
Please do not rely on AI when you need 100% precise answers. AI can give you good hints where to start your search. But it is not a documentation. AI gives you the most LIKELY answer it can calculate, that might not be 100% correct. (Sorry for writing a whole post, but I'm not yet allowed to write comments. :( )
So, the answer from Bona Fide is correct.
Upvotes: 1