12

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?

Zoe
  • 27,060
  • 21
  • 118
  • 148
Andrei Herford
  • 17,570
  • 19
  • 91
  • 225
  • might get faster help here, http://forums.developer.amazon.com/forums/index.jspa – petey Sep 12 '14 at 17:58
  • Already tried this of course but so far I did not get any reply. Actually the Amazon forum seems not to be a good place to get help. I also contacted Amazon directly, so far without any feedback as well. – Andrei Herford Sep 13 '14 at 06:34
  • Altho most of the time the forum posts end up in involving a "contact us", I've had positive experiences. Might be worth trying again. – petey Sep 15 '14 at 13:54
  • Did you ever solve this problem? Let me know please. – Scuba Kay Dec 17 '14 at 11:29

2 Answers2

7

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.

Andrei Herford
  • 17,570
  • 19
  • 91
  • 225
  • 2
    Hi I am having the same problem in Live App Testing. My app is not using Proguard so I don't think there is an obfuscation issue. Also from looking at the Amazon forums there is no sensible help I can find. What did you do to solve the issue ? – user1785227 May 21 '15 at 10:16
  • 1
    This is a good idea to check, but didn't explain the problem I'm having. FWIW, I have `-keep public class com.amazon.** { *; }` in my proguard-rules file. – arlomedia Jun 03 '16 at 22:17
-1

Are you registering Amazon's callback listener in your MainActivity.onCreate(...)?

PurchasingService.registerListener(this.getApplicationContext(), new YourCallbackPurchasingListener());

If you do not, try that out.