question

jacquesgiraudel avatar image
jacquesgiraudel asked

Check entitlement without internet

Hello, I am implementing a in app purchasing logic into an app. I don't want that, after the user changes the amazon account on the device, the user has still access to entitlements bought with the previous one. So my first idea is to store the amazon email of the user when he buys the entitlement and to check it when the app start. To do that, I must be able to retrieve the user amazon email. The in app purchase API permits to do that when the user is connected to the internet. But, I don't want the user to need to be connected to the internet to be able to use the app with the entitlement. Is there a way to get the amazon account email when the device is not connected to the internet ? Do you see any other solution to fill this use case ? Thank you
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.

1 Answer

Bipin@Amazon avatar image
Bipin@Amazon answered
The entitlement should be stored against the user ID returned by the IAP API. That way the app should be able to retrieve entitlements offline. A good practice here is to always check for the current userID in the onResume method to account for the user changing when the app is not in control. Please refer below link for more information https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/implementing-iap-2.0#6.%20Getting%20the%20Current%20User%27s%20Data
10 |5000

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