2013-02-27 67 views
2

我是新應用內結算谷歌播放,我從谷歌下載示例,並得到TrivialDrive項目。我只是改變SKU_GAS到"android.test.purchased"但我成功以後買燃料,我得到的結果:應用內結算V3

02-27 14:24:40.882: D/TrivialDrive(11805): Consumption finished. Purchase: PurchaseInfo(type:inapp): 
{"packageName":"com.example.android.trivialdrivesample","orderId":"transactionId.android.test.purchased","productId":"android.test.purchased","developerPayload":"","purchaseTime":0,"purchaseState":0,"purchaseToken":"inapp:com.example.android.trivialdrivesample:android.test.purchased"}, result: IabResult: Successful consume of sku android.test.purchased (response: 0:OK) 

我的問題爲什麼purchaseTime = 0?什麼是developerPayload?謝謝

回答

1

你得到purchaseTime=0,因爲你使用的是android測試產品:android.test.purchased。約在developerPayload這裏是API的解釋:

A developer-specified string that contains supplemental information about an order. You can specify a value for this field when you make a getBuyIntent request. 

在這裏你可以找到更多的信息Android In-App Billing

+0

謝謝你的回答。另一個問題,如果我只想購買一次,代碼中有什麼要做?因爲與android.test.purchased我可以購買多個...我發現這個http://stackoverflow.com/q/6006517/1468452 ,它使用android.test.purchased,但purchaseTime!= 0 – 2013-02-27 07:42:40

+1

您擁有'MANAGED'和'UNMANAGED'產品。非託管產品可以多次澆灌並且只管理一次。您在創建產品時必須在Google Play開發者帳戶中設置此選項。 – hardartcore 2013-02-27 07:46:53

+0

因此,如果我設置MANAGED產品,它只會購買一次?以及我如何檢索我已經購買的產品信息?例如,如果我改變我的手機或重新安裝我的應用程序? – 2013-02-27 07:49:11