0

I am implementing in app purchase in my app. Before purchasing in app product I need to disable the Button which is having extra features.

I tried '''clikButton.setEnabled(false)'''

After buying in app purchase I putted '''clickButton.setEnabled(true)'''

After in app purchase completion, the button getting enabled. But if close the app and open again it's going to disabled state. So, user need to Buy multiple times. How to solve this issue.

Detailed code: How to setup In App purchase (Non Consumable)?

1 Answers1

0

Use Google Play Billing Library and make a call to queryPurchases API. If you find this in-app item from the query results, set the button to true.

Check their best practices at: https://github.com/android/play-billing-samples/tree/master/TrivialDrive_v2

DrPower
  • 445
  • 3
  • 6