question

amazongangadhar avatar image
amazongangadhar asked

How to track auto renewal subscription in IAP - 2.0

HI, I have implemented IAP Subsciption 2.0 For my server side validation or To do entry in My Server Table: When network is OFF, How to get the auto-renewed receipt to do entry in My-Server-Table after network turned to ON. Is it enough to call wherever i required auto-renewed receipts. PurchasingService.getPurchaseUpdates(false); If it is right, when to put false and true. Please help me. Thank you. [u][/u][b][/b]
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.

Bipin@Amazon avatar image
Bipin@Amazon answered
You can not check subscription status in offline mode. The best way to ensure the subscription is valid is to make a call to getPurchaseUpdatesRequest() when the app starts. This way, you can examine the response and see if the user is still subscribed to the content. You just look for the most recent receipt for the parent SKU, and if the end date on the receipt is null, then the user is still subscribed. You can go through below threads for more information. https://forums.developer.amazon.com/forums/thread.jspa?messageID=3527 https://forums.developer.amazon.com/forums/thread.jspa?messageID=3666 Setting reset equal to false in PurchasingService.getPurchaseUpdates() will give you a paginated response of purchase history since the last call to getPurchaseUpdates(); this is the recommended approach Setting reset equal to true indicates you want a paginated response of the entire purchase history for the customer. Please refer : https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/implementing-iap-2.0#7.%20Retrieving%20Purchase%20History%20for%20the%20Current%20User
1 comment
10 |5000

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

Yaroslav_Havrylovych avatar image Yaroslav_Havrylovych commented ·

Those links are unavailable, but from the doc (and IAP example code) we're making

PurchasingService.getPurchaseUpdates(reset);

each time we want to query subs (e.g. app start). And the response come from Amazon Sdk. So what if user offline, what this getPurchaseUpdates would return?

P.S. I didn't find in the doc, maybe you could point me to.

0 Likes 0 ·
amazongangadhar avatar image
amazongangadhar answered
Thank you very much
10 |5000

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

amazongangadhar avatar image
amazongangadhar 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.