Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon IAP SDK: No response when testing IAPs in Live App Testing

I am trying to integrate the latest version of the Amazon IAP API into my Android 4+ app. Everything seems to work just fine when the app is sideloaded onto my test devices (Nexus 5 and Kindle Fire) and used with the Amazon App Tester. The IAPs can be purchased without any problem.

Know I have uploaded a "Live App Testing" version of the app to the Amazon store and installed it on my test devices. Running this versions IAPs are not possible.

This is the log output when using the sideloaded version with App Tester:

D/PTLog      (14109): IAPManager - init - using Amazon 

D/d          (14109): In App Purchasing SDK - Sandbox Mode: PurchasingListener registered: xyz.IAPManager@425fe410
D/d          (14109): In App Purchasing SDK - Sandbox Mode: PurchasingListener Context: xyz
D/c          (14109): In App Purchasing SDK - Sandbox Mode: sendPurchaseUpdatesRequest/sendGetUserData first:GET_USER_ID_FOR_PURCHASE_UPDATES_PREFIX:1:fca787d5-4b9d-42e4-840f-ff28f3d13ac4
W/ContextImpl(14109): Implicit intents with startService are not safe: Intent { act=com.amazon.testclient.iap.appUserId flg=0x10000000 (has extras) } android.content.ContextWrapper.startService:494 com.amazon.device.iap.internal.a.c.a:87 com.amazon.device.iap.internal.a.c.a:150
D/c          (14109): In App Purchasing SDK - Sandbox Mode: sendItemDataRequest
W/ContextImpl(14109): Implicit intents with startService are not safe: Intent { act=com.amazon.testclient.iap.itemData flg=0x10000000 (has extras) } android.content.ContextWrapper.startService:494 com.amazon.device.iap.internal.a.c.a:137 com.amazon.device.iap.internal.d.a:103
D/c          (14109): In App Purchasing SDK - Sandbox Mode: handleResponse 
I/c          (14109): sendGetPurchaseUpdates with user idl3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=
I/c          (14109): send PurchaseUpdates with user id:l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=;reset flag:true, local cursor:null, parsed from old requestId:GET_USER_ID_FOR_PURCHASE_UPDATES_PREFIX:1:fca787d5-4b9d-42e4-840f-ff28f3d13ac4
W/ContextImpl(14109): Implicit intents with startService are not safe: Intent { act=com.amazon.testclient.iap.purchaseUpdates flg=0x10000000 (has extras) } android.content.ContextWrapper.startService:494 com.amazon.device.iap.internal.a.c.a:421 com.amazon.device.iap.internal.a.c.e:388
D/c          (14109): In App Purchasing SDK - Sandbox Mode: handleResponse

As you can seen the Purchasing SDK is initialised just fine. Now, when using the Live App Testing version the log shows the following:

D/PTLog (18032): IAPManager - init - using Amazon
D/Kiwi  (18032): In App Purchasing SDK - Production Mode: d: PurchasingListener registered: xyz.a.a.d@410435f8
D/Kiwi  (18032): In App Purchasing SDK - Production Mode: d: PurchasingListener Context: xyz@41021558
D/Kiwi  (18032): In App Purchasing SDK - Production Mode: a: sendGetPurchaseUpdates
D/Kiwi  (18032): Kiwi: WARNING: Use of deprecated method detected.
E/Kiwi  (18032): Kiwi: Kiwi subsystem is not fully initialized. Cannot process task.
D/Kiwi  (18032): In App Purchasing SDK - Production Mode: a: sendGetProductDataRequest
D/Kiwi  (18032): Kiwi: WARNING: Use of deprecated method detected.
E/Kiwi  (18032): Kiwi: Kiwi subsystem is not fully initialized. Cannot process task.

As you can see there seems to be a problem with the Purchasing SDK:

"Kiwi: WARNING: Use of deprecated method detected."

It does not matter if the Live App Testing version is used on Kindle or on the Nexus with the latest version of the Amazon Store app. The result is exactly the same: IAPs are not possible.

Is this a known issue? How can this be solved?

Thank you very much

like image 935
Andrei Herford Avatar asked Sep 11 '14 08:09

Andrei Herford


People also ask

How do I test Amazon in-app purchasing (IAP)?

See Testing In-App Purchasing (IAP). Amazon provides an App Tester tool for performing unit testing of IAP. You can test out this tool with the IAP sample apps. To install the App Tester and enable the sample app to run on the App Tester: Follow the instructions in Installing and Configuring the App Tester.

How does the IAP API interact with the live Amazon Appstore?

The IAP API requests from the app will interact with the live Amazon Appstore. You use the RVS Production environment to verify receipts. Any In-app purchases (that are not free) are charged to the user.

How do I test my IAP API before submitting my app?

Use App Tester to test your IAP API code before you submit your app to the Amazon Appstore. App Tester runs in sandbox mode to perform unit testing of the IAP API method calls in your app. App Tester intercepts the IAP API requests sent from your app. App Tester generates the API responses, based on a JSON data file that you provide.

How do I set up sandbox mode for IAP API?

You need to set your app in debug mode to run sandbox mode. See App Tester User Guide. The IAP API v2.0 detects this mode automatically. API requests are not sent to the Appstore; they are redirected locally to App Tester. You use App Tester to perform unit testing of the IAP API method calls in your app.


1 Answers

I finally found a solution for the problems described in my question. Sorry for not posting this earlier...

There is a hint in the Amazon API docs that describes that there are some limitations one can use to obfuscate the code. It seems that some API does not work any more if the obfuscation is too strong.

like image 158
Andrei Herford Avatar answered Oct 23 '22 00:10

Andrei Herford