I have updated Android Billing library to version 2.0 (released this month).
In addition to minor changes (that is useless to report here) I have edited this line to support the new library version:
cl = BillingClient.newBuilder(mActivity).setListener(this).build();
in this way:
cl = BillingClient.newBuilder(mActivity).enablePendingPurchases().setListener(this).build();
since as stated by release notes enablePendingPurchases()
is required (and without this App crashes).
In order to get the all Skus to fulfill the removal of methods for Sku hardcoding (honestly I don't how removing them is supposed to improve something), I have tried to query using this code querySkuDetails()
:
SkuDetailsParams.Builder spb = SkuDetailsParams.newBuilder();
cl.querySkuDetailsAsync(spb.build(), new SkuDetailsResponseListener() {
@Override
public void onSkuDetailsResponse(BillingResult br, List<SkuDetails> ls) {
}
});
But the BillingResult
response code is always 5 DEVELOPER_ERROR
if I place the method call in onBillingClientSetupFinished
.
The previous version has no issue, and I'm wondering if I'm missing something to support the new version properly.
Billing service is able to connect to its backend, but this operation for some reason fails. So seems that error is in the way I use querySkuDetails()
because onSkuDetailsResponse
returns always code 5 DEVELOPER ERROR
despite the status code I get inonBillingSetupFinished
is OK
.