My application has a single one-time non-consumable IAP to turn off advertisement. I'm trying to provide a "Restore Purchase" option for my application. In the event a user uninstalls the application or migrates to a new device, they have an option to recover their one-time past purchase.
My app is following the purchase flow described within Google's documentation https://developer.android.com/google/play/billing/integrate
I've looked for examples to restore a past purchase for a different device, but all the examples I've found are out dated referencing the AIDL methods.
I've looked at methods, BillingClient.queryPurchases()
and BillingClient.queryPurchaseHistoryAsync()
. queryPurchaseHistoryAsync()
give a list of PurchaseHistoryRecord
s, for all past purchases including canceled purchases, but does not provide the purchase status to determine if any of those are a completed or pending purchase.
In contrast, queryPurchases()
will give a list of purchases and their status, but only for the device. It returns an empty list if a user made the IAP on a different device.
I do not have a backend as I'm an independent developer with limited resources, so my app must be self-contained.
Any help is appreciated. Thanks.