【问题标题】:Amazon IAP SDK: No response when testing IAPs in Live App TestingAmazon IAP SDK:在 Live App Testing 中测试 IAP 时无响应
【发布时间】:2014-11-05 02:36:55
【问题描述】:

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

知道我已将应用程序的“实时应用程序测试”版本上传到亚马逊商店并将其安装在我的测试设备上。无法运行此版本的 IAP。

这是使用带有 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

如您所见,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."

Live App Testing 版本是在 Kindle 上还是在 Nexus 上使用最新版本的 Amazon Store 应用程序都没有关系。结果完全一样:IAP 是不可能的。

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

非常感谢

【问题讨论】:

  • 可能会在这里获得更快的帮助,forums.developer.amazon.com/forums/index.jspa
  • 当然已经尝试过了,但到目前为止我没有得到任何回复。实际上,亚马逊论坛似乎不是获得帮助的好地方。我还直接联系了亚马逊,到目前为止也没有任何反馈。
  • 尽管大多数时候论坛帖子最终都涉及“联系我们”,但我有过积极的经历。可能值得再试一次。
  • 你解决过这个问题吗?请告诉我。

标签: android in-app-purchase amazon


【解决方案1】:

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

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

【讨论】:

  • 您好,我在 Live App 测试中遇到了同样的问题。我的应用程序没有使用 Proguard,所以我认为不存在混淆问题。同样从亚马逊论坛上看,我找不到任何明智的帮助。你做了什么来解决这个问题?
  • 这是一个检查的好主意,但没有解释我遇到的问题。 FWIW,我的 proguard-rules 文件中有-keep public class com.amazon.** { *; }
【解决方案2】:

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

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

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

【讨论】:

    猜你喜欢
    • 2015-07-15
    • 2019-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-02
    • 2012-09-20
    • 2023-02-18
    • 2022-01-07
    相关资源
    最近更新 更多