I'd like to use android billing version 5. The problem is that I was using version 3 and some things are now deprecated.
I had this but PurchasesResult, queryPurchases and getPurchasesList doesn't exist anymore:
@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);
}
How can I make it work on version 5?
Also cannot resolve getSku():
//if purchase is pending
else if( PRODUCT_ID.equals(purchase.getSku()) && purchase.getPurchaseState() == Purchase.PurchaseState.PENDING)
{
Toast.makeText(getApplicationContext(),
R.string.plus_pending, Toast.LENGTH_SHORT).show();
}
Thanks