Amazon IAP doesn't invoke onPurchaseResponse

2019-06-27 20:33发布

问题:

I have an android app, which is using IAP. I'm sending PurchasingManager.initiateGetUserIdRequest() and getting the user ID successfully in onGetUserIdResponse.

After getting the response the PurchasingManager.initiatePurchaseRequest("sku") is invoked, but unfortunately the desired onPurchaseResponse seems never be called.

My applications IAP items are approved by amazon. Any help on this?

回答1:

In our case, the issue ended up being that we had added the android:exported="false" flag to our Amazon IAP Response Receiver in the manifest:

<receiver android:name="com.amazon.inapp.purchasing.ResponseReceiver"
          android:exported="false" >
...
</receiver>

This prevents the Amazon purchasing application from being able to call back to your app via intents so you need to remove it. Lesson learned...