question

qtoppler avatar image
qtoppler asked

Handling already entitled items

Looking at the example code for entitled in app purchases, and confused as to how to handle "ALREADY_ENTITLED" items... case ALREADY_ENTITLED: /** * If the customer has already been entitled to the item, a receipt is not returned. * Fulfillment is done unconditionally, we determine which item should be fulfilled by matching the * request id returned from the initial request with the request id stored in the response. */ final String requestId = purchaseResponse.getRequestId(); editor.putBoolean(baseActivity.amazonRequestIds.get(requestId), true); editor.commit(); Based on the above, it would seem that the request Id returned if an item has already been entitled should be the request Id of the original purchase. In testing, every purchase or purchaseUpdates request has a different request id, and the request id in the purchaseResponse for the already entitled item is NOT the request Id of the original purchase.... can someone verify? Message was edited by: qtoppler
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.

Samuel@Amazon avatar image
Samuel@Amazon answered
Hi, we are following up on your question and we will get back to you once we have an update. Thanks
10 |5000

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

qtoppler avatar image
qtoppler answered
Any news on this?
10 |5000

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

Samuel@Amazon avatar image
Samuel@Amazon answered
Hi qtoppler, sorry for delay in getting back to you. requestId will not be same and it will be different each time a request is initiated. We track the IAP items which are already entitled using purchaseToken value. Purchase Token value do not identify a transaction, you will get different Purchase Tokens to identify transactions depending on when you ask for it. Using request Id we will match to which Item you are requesting and check the Item using your Purchase Token. Hope this information helps. Thank you.
10 |5000

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

qtoppler avatar image
qtoppler answered
Couple things I don't understand: 1) The example I quoted above- the request ID in the response doesn't match the earlier request ID. Is it not trying to do something you say isn't possible? 2) Where do we get the purchaseToken if the item is already entitled? Thanks
10 |5000

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

Samuel@Amazon avatar image
Samuel@Amazon answered
Hi qtoppler, please find answers for your questions, 1) Request id is just a value which we used to match asynchronous response to the request. if you call "initiateItemDataRequest", you will be returned a string, which is the requestID for that request and as you handle "ItemDataResponse" in the onItemDataResponse() callback, you can check the ItemDataResponse.getRequestID() value to see which request generated the response in question. 2) We will get the purchase token value in "Receipt" you got when you completed the purchase. But ALREADY_ENTITLED case occurs when you attempt to purchase something you already bought, so for this you will not have any receipt. To get receipt for that transaction, you should call initiatePurchaseUpdatesRequest api which will give you set of receipts. Thank you.
10 |5000

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

Steven Zhang avatar image
Steven Zhang answered
2)If I have purchased and paid for, but did not get the receipt due to network reasons, then do you mean always will no longer receive a receipt
10 |5000

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

Samuel@Amazon avatar image
Samuel@Amazon answered
Hi Steven, if you did successful purchase and haven't got receipt due to network reasons, the same receipt will be pushed to your app for the next purchase you do. Thank you.
10 |5000

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

movie buff.. avatar image
movie buff.. answered
What happens when a user buys an entitled product and then uninstalls the app. Reinstall the app, the entitled product should be assigned to him. How do we handle this.
10 |5000

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