我正在尝试实施应用内结算。我已登录到在Market上注册的测试帐户,并且我已更新了代码中的公钥。我可以购买其中一个测试产品ID。Android应用内结算:购买后收到空白数据
但是,似乎在PURCHASE_STATE_CHANGED意图中发送了空白签名。日志显示为这样:
INFO/BillingReceiver(21437): notifyId: android.test.purchased
WARN/ActivityManager(2513): Duplicate finish request for HistoryRecord{47de4b38 com.android.vending/.billing.InAppBuyPageActivity}
INFO/BillingService(21437): handleCommand() action: com.app.GET_PURCHASE_INFORMATION
DEBUG/BillingService(21437): GetPurchaseInformation
ERROR/BillingService(21437): getPurchaseInformation received RESULT_OK
DEBUG/BillingService(21437): request id: 4241021538346688898
INFO/BillingService(21437): handleCommand() action: com.android.vending.billing.RESPONSE_CODE
DEBUG/BillingService(21437): RequestPurchase: RESULT_OK
INFO/BillingService(21437): handleCommand() action: com.android.vending.billing.PURCHASE_STATE_CHANGED
INFO/Security(21437): signedData: {"nonce":-3927284292945900504,"orders":[{"notificationId":"android.test.purchased","orderId":"transactionId.android.test.purchased","packageName":"com.app","productId":"android.test.purchased","purchaseTime":1301944310410,"purchaseState":0}]}
INFO/Security(21542): signature:
INFO/Security(21437): Purchase not verified
INFO/Security(21437): Purchase count = 0
INFO/BillingService(21437): handleCommand() action: com.android.vending.billing.RESPONSE_CODE
DEBUG/BillingService(21437): GetPurchaseInformation: RESULT_OK
“购买未验证”是由于代码跳过签名验证(因为它是空白)和折腾出该产品的购买。
有什么想法?我没有在文档中看到签名可能是空白的或者原因是什么。
FWIW,这只发生在我的三星Vibrant Galaxy S(2.2.1)上。它适用于Droid(2.2.2)。
编辑:当我拿到PURCHASE_STATE_CHANGED意图为恢复交易操作的结果,我得到这个,而不是在日志中:
INFO/BillingService(24010): handleCommand() action: com.android.vending.billing.PURCHASE_STATE_CHANGED
ERROR/Security(24010): data is null
这表明没有签订有效载荷在所有发送。
编辑:在进一步测试中,似乎发生这种情况时,上传的应用程序和安装的应用程序的版本不同。 http://code.google.com/p/marketbilling/issues/detail?id=15
有趣。我有同样的经历,虽然每次我上传一个新APK时,问题似乎都会重演。我提交了一个错误:http://code.google.com/p/marketbilling/issues/detail?id = 15 – sehugg 2011-04-14 17:08:04