我正在嘗試實施應用內結算。我已登錄到在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