Hi! I want add paid function to my Android application and don't want to offer purchase if it is already done. I don't see any API for this. I can store purchase status in SharedPreferences, but user can reinstall app or clear its data. So, some API call is still needed. How can I get list of purchased items or check if some item is purchased?
Hi Darjarr, Thank you for showing interest in Amazon IAP. In-App Purchasing API allows for the three different types of purchasable items: Consumable Content - content that does not require an entitlement or access rights to use, can be purchased multiple times by a customer, is available only on the device it is purchased from, and does not require any type of entitlement check to use Entitled Content - content that requires an entitlement or access rights to use, can be purchased only once by a customer, and is available on all compatible devices registered to the customer's account Subscription Content - content that requires an entitlement or access rights to use, is bound by a period of time, that auto-renews, and is available on all eligible devices registered to the customer's Amazon account So for consumable content, if user uninstalls the app, the purchased items would be gone. But for other two types you can ask PurchasingManager any time what are the items are purchased by current user. The api is, public static java.lang.String initiatePurchaseUpdatesRequest(Offset offset) Initiate a request to retrieve updates about items the customer has purchased and/or revoked since last time you checked based on offset. A good use of this operation is to invoke it once per application run to make sure your view of ownership is consistent across devices.This operation works with paginated data. The beginning of the data set is specified by the Offset you provide here. The response will contain an Offset marking the beginning of the next data set, if more is available. If you call this method of PurchasingManager, you should get a callback on onPurchaseUpdatesResponse of your PurchasingObserver subclass implementation with a instance of PurchaseUpdatesResponse which would contain purchase receipts of already bought items and the sku names to be revoked. For details you can refer below links
https://developer.amazon.com/sdk/in-app-purchasing/reference/api-reference.htmlhttps://developer.amazon.com/sdk/in-app-purchasing.html Hope this helps.