Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. I can purchase one of the test product IDs.

However, it appears that a blank signature is sent in the PURCHASE_STATE_CHANGED intent. 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). It works fine on a 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:

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

like image 235
sehugg Avatar asked Nov 05 '22 00:11

sehugg


1 Answers

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.

To fix it I uploaded the new apk as a draft to the market, then I got valid responses.

like image 74
Uwe Maurer Avatar answered Nov 11 '22 10:11

Uwe Maurer