Hi,
I bought a subscription and called
PurchasingService.notifyFulfillment(receipt.receiptId, FulfillmentResult.FULFILLED)
but when I want to restore my purchase on another device with the same amazon account when I call
PurchasingService.getPurchaseUpdates(true)
I receive "success" but it doesn’t return any receipts.
* it works on os version 6+ and only not working on version 5 and just return an empty list.
is version 5 still supported by amazon?
how can I solve it on version 5?
I am using android studio with Gradle v4.0.1 and amazon IAP v2 and the live test environment.
this is my listener code:
override fun onPurchaseUpdatesResponse(response: PurchaseUpdatesResponse) { Log.d(TAG, "---------- [IAP] onPurchaseUpdatesResponse ----------") when (response.requestStatus) { PurchaseUpdatesResponse.RequestStatus.SUCCESSFUL -> { val handler = Handler() val runnable = Runnable { Log.d(TAG, "[IAP] SUCCESS") if (response.receipts.size == 0) { Log.d(TAG, "[IAP] COULDN'T FIND ANY RECEIPT!!!") PurchasingService.getUserData() } if (response.hasMore()) { PurchasingService.getPurchaseUpdates(false) } for (receipt in response.receipts) { handleReceipt?.let { it(response.requestId.toString(), receipt, response.userData) } } } handler.post(runnable) } PurchaseUpdatesResponse.RequestStatus.FAILED, PurchaseUpdatesResponse.RequestStatus.NOT_SUPPORTED -> { Log.d(TAG, "onProductDataResponse: failed, should retry request") } else -> { } } }
and this is my log
--------- beginning of amazon_main 01-13 11:27:20.681 13160-13160/com.app.pro.debug D/listener: onPurchaseUpdatesResponse: requestId (5d32f40b-06d1-40f9-862a-acde57482a22) purchaseUpdatesResponseStatus (SUCCESSFUL) userId (o3THCMSJLoIlJKDHjxNzda1kFZvdg7hEt_ybBOHhKA0=) 01-13 11:27:20.681 13160-13160/com.app.pro.debug D/listener: ---------- [IAP] onPurchaseUpdatesResponse ---------- 01-13 11:27:20.682 13160-13160/com.app.pro.debug D/listener: [IAP] SUCCESS 01-13 11:27:20.682 13160-13160/com.app.pro.debug D/listener: [IAP] COULDN'T FIND ANY RECEIPT!!! 01-13 11:27:20.717 13160-13160/com.app.pro.debug D/listener: onGetUserDataResponse: requestId (03e63092-8fc0-490a-942b-963bc461de7b) userIdRequestStatus: SUCCESSFUL) 01-13 11:27:20.717 13160-13160/com.app.pro.debug D/listener: onUserDataResponse: get user id (o3THCMSJLoIlJKDHjxNzda1kFZvdg7hEt_ybBOHhKA0=, marketplace (US)