Amazon IAP SDK:在Live App Testing中测试IAP时无响应

时间:2014-09-11 08:16:32

标签: android in-app-purchase amazon

我正在尝试将最新版本的Amazon IAP API集成到我的Android 4+应用程序中。当应用程序被侧载到我的测试设备(Nexus 5和Kindle Fire)并与Amazon App Tester一起使用时,一切似乎都能正常工作。可以毫无问题地购买IAP。

知道我已将该应用的“Live App Testing”版本上传到亚马逊商店并将其安装在我的测试设备上。运行此版本的IAP是不可能的。

这是在App Tester中使用sideloaded版本时的日志输出:

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

正如您所见,Purchasing SDK初始化正常。现在,使用Live App Testing版本时,日志显示以下内容:

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.

正如您所看到的,采购SDK似乎存在问题:

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

如果使用最新版本的亚马逊商店应用程序在Kindle或Nexus上使用Live App Testing版本并不重要。结果完全相同:IAP是不可能的。

这是一个已知问题吗? 怎么解决这个问题?

非常感谢

2 个答案:

答案 0 :(得分:5)

我终于找到了解决我问题中描述的问题的方法。很抱歉没有发布此内容......

有一个hint in the Amazon API docs描述了可以用来混淆代码的一些限制。如果混淆太强,似乎某些API不再起作用。

答案 1 :(得分:0)

您是否在MainActivity.onCreate(...)中注册了亚马逊的回调侦听器?

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

如果你不这样做,试试吧。