android billing:4.0.0 - purchase.getSku()

Viewed 785

I have a problem using the android billing 4.0.0 version. I have used it before:

purchase.getSku()

I have this old code to check if it's purchased:

PRODUCT_ID.equals(purchase.getSku()) && purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED) 

I have updated to this code:

getResources().getString(R.string.Product_ID).equals(purchase.getSkus() .contains(getResources().getString(R.string.Product_ID)) && purchase.getPurchaseState() == Purchase.PurchaseState.PENDING)

but after purchase the item nothing in the app change. is it like I have not bought it.
what I am doing wrong?

1 Answers

I found a solution, I hope this will help some others. I have removed

getResources().getString(R.string.Product_ID).equals

so it will be:

purchase.getSkus().contains(getResources().getString(R.string.Product_ID)) && purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED
Related