question

unifiedintents avatar image
unifiedintents asked

Not receiving any receipts

I previously implemented the IAP V1 library in my app. I published the app, and purchased the IAP item to test. This seemed to work fine. However, soon after releasing we noticed a lot of crash reports from the sample IAP code that we used. So, I decided to change to the new V2 library. Now, testing using the Test App works fine. However, when I try using the updated published app the app never seems to receive any receipts. I can see in the logs that "onPurchaseUpdatesResponse" is invoked. In this callback a loop through all of the receipts in the response and log some information. This never shows up in logs when I run the published app. Also, when I try to purchase the IAP item again, I can see that the "onPurchaseResponse" method is invoked with status "ALREADY_PURCHASED" (as expected). For that status the app should log the receipt information as well, which doesn't show up either. The only idea I have at the moment is that it might have something to do with ProGuard (since my code doesn't seem to be executing as I expect it to). My proguard.cfg file contains the following: -keep class com.amazon.** {*;} -keepattributes *Annotation* Is there anything else I should be including?
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.

unifiedintents avatar image
unifiedintents answered
Update: I just had my colleague test purchasing the app on his device with his account (he has never purchased the app before). Everything worked fine for him. In the logs we can see that he receives a receipt. Are purchases made with the V1 library not compatible with the V2 library?
10 |5000

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

Sujoy@Amazon avatar image
Sujoy@Amazon answered
We are looking into your app. I will get back to you shortly. 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.

unifiedintents avatar image
unifiedintents answered
I added some more logging code to my app. 1) onPurchaseUpdatesResponse does not provide any receipts. 2) onPurchaseResponse (ALREADY_PURCHASED) does not provide a receipt (it is null). Is this as designed? In the mean time I will unlock the IAP when ALREADY_PURCHASED occurs (when though I can't verify the SKU).
10 |5000

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

Sujoy@Amazon avatar image
Sujoy@Amazon answered
I am still in touch with the team for this issue. I will let you once I receive a reply from them. 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.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
1. onPurchaseUpdatesResponse should provide receipts for purchases since the last call if an offset is sent as part of the request. If there is no offset in the request then all receipts will be returned. Can you please provide the code how your app implements initiatePurchaseUpdatesRequest? 2. Yes, this is by design. If the customer has already purchased the item the response will contain ALREADY_PURCHASED but there is no corresponding receipt. The recommended course from here is to unlock the content.
10 |5000

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

unifiedintents avatar image
unifiedintents answered
https://gist.github.com/ui-philip/ba22f1ce69f6283bc027#file-gistfile1-java Could the problem be that i pass "false" to "getPurchaseUpdates"? /Philip
10 |5000

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

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Yes, that could be the problem. Passing false to getPurchaseUpdates() will only return new receipts since the last getPurchaseUpdates() call. This app has only one entitlement, so once they received a receipt in purchaseUpdates they will not get it again if they call getPurchaseUpdates() with false. If you need the receipt for this purchase everytime, you should call it with flag true.
10 |5000

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