question

beatificbytes avatar image
beatificbytes asked

Is it necessary to store information about bought entitlements locally

Hi, I'm in the middle of implementing IAP v2.0. The code in the SampleIAPEntitlementsApp shows that after an entitlement was bought, it is stored in a database locally on the device. Do you absolutely have to save this information locally? Is it possible to retrieve information which entitlements the user bought on app start up? Is this possible with and without internet connection? If you absolutely have to store the information locally how are other devices of the user notified? Regards, Ben
iap
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

beatificbytes avatar image
beatificbytes answered
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nick Gardner avatar image
Nick Gardner answered
Hi, It is suggested that you cache the information locally, but not an absolute requirement. Otherwise you should be able to simply call getPurchaseUpdates() on launch of the app to check the status of purchases. Thanks, Nick
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

onesrv avatar image
onesrv answered
But calling getPurchaseUpdates() , in the corresponding listener's method I cannot retrieve any information about wheter item is already purchased or not . I can only know if item is available to purchase or not! What am I doing wrong?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nick Gardner avatar image
Nick Gardner answered
Hi, It should have all purchase information, not just whether the item is available. This is partly so you can transfer entitlements across devices. Per our guidance: onPurchaseUpdatesResponse(PurchaseUpdatesResponse purchaseUpdatesResponse): Invoked after a call to getPurchaseUpdates(boolean reset). Retrieves the purchase history. Amazon recommends that you persist the returned PurchaseUpdatesResponse data and query the system only for updates. -Nick
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.