I'm trying to convert android billing version 3 to android billing version 5. But I have a problem in this function, I have no idea how to change it to make it work:
@Override
public void onBillingSetupFinished(@NonNull BillingResult billingResult) {
if(billingResult.getResponseCode()==BillingClient.BillingResponseCode.OK){
Purchase.PurchasesResult queryPurchase = billingClient.queryPurchases(INAPP);
List<Purchase> queryPurchases = queryPurchase.getPurchasesList();
if(queryPurchases!=null && queryPurchases.size()>0){
handlePurchases(queryPurchases);
}
//if purchase list is empty that means item is not purchased
//Or purchase is refunded or canceled
else{
savePurchaseValueToPref(false);
removepremium();
}
}
}
Cannot resolve: PurchasesResult, queryPurchases, getPurchasesList...
How can I change this to work in billing 5?