简体   繁体   English

Android应用内结算:购买后收到空白数据

[英]Android In-App Billing: Blank data received after purchase

I'm trying to implement In-App Billing. 我正在尝试实施应用内结算。 I'm signed into a test account registered with the Market, and I've updated my public key in the code. 我已登录到在Market注册的测试帐户,并且我已在代码中更新了我的公钥。 I can purchase one of the test product IDs. 我可以购买其中一个测试产品ID。

However, it appears that a blank signature is sent in the PURCHASE_STATE_CHANGED intent. 但是,似乎在PURCHASE_STATE_CHANGED意图中发送了空白签名。 The log appears as such: 日志显示如下:

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

The "Purchase not verified" is due to the code skipping the signature verification (because it is blank) and tossing out that product purchase. “购买未经验证”是由于代码跳过签名验证(因为它是空白的)并且抛弃了产品购买。

Any idea? 任何想法? I don't see in the docs anywhere that the signature could be blank or what the reason would be. 我没有在文档中看到签名可能是空白的或原因是什么。

FWIW, this only happens on my Samsung Vibrant Galaxy S (2.2.1). FWIW,这只发生在我的三星Vibrant Galaxy S(2.2.1)上。 It works fine on a Droid (2.2.2). 它在Droid(2.2.2)上工作正常。

EDIT: When I get the PURCHASE_STATE_CHANGED Intent as the result of a restore transactions operation, I get this instead in the logs: 编辑:当我得到PURCHASE_STATE_CHANGED意图作为恢复事务操作的结果时,我在日志中得到了这个:

INFO/BillingService(24010): handleCommand() action: com.android.vending.billing.PURCHASE_STATE_CHANGED
ERROR/Security(24010): data is null

This indicates that no signed payload was sent at all. 这表明根本没有发送签名的有效负载。

EDIT: On further testing it seems that this occurs when the versions of the uploaded app and the installed app differ. 编辑:在进一步测试时,似乎这发生在上传的应用程序的版本和安装的应用程序不同时。 http://code.google.com/p/marketbilling/issues/detail?id=15 http://code.google.com/p/marketbilling/issues/detail?id=15

I also ran into this problem. 我也遇到了这个问题。 I increased the versionCode of the apk, signed it correctly but then only got these null responses from the market. 我增加了apk的versionCode,正确签名但后来只得到了来自市场的这些空响应。

To fix it I uploaded the new apk as a draft to the market, then I got valid responses. 为了解决这个问题,我将新的apk作为草稿上传到了市场,然后得到了有效的回复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM