1

我们在 Android 的应用内购买消息流的最后部分看到“服务不可用”错误,我们不知道为什么。

我们已经实现了 Android 的应用内计费,并且一切运行良好,我们几乎可以通过消息序列获得所有信息:

1) 我们发送 REQUEST_PURCHASE 消息并返回 RESPONSE_CODE 为 0

2) 我们收到 com.android.vending.billing.IN_APP_NOTIFY

3) 我们发送 GET_PURCHASE_INFORMATION 消息并返回 RESPONSE_CODE 0

4) 我们收到 com.android.vending.billing.PURCHASE_STATE_CHANGED

5)我们发送的是CONFIRM_NOTIFICATIONS。

我们查看了 Google 提供的示例应用程序 (com.android.vending.billing),它表示我们必须在 CONFIRM_NOTIFICATIONS 消息中提供的只是通知 ID 的字符串数组。我们从最后一条消息收到的响应是 BroadcastReceiver 中的 com.android.vending.billing.RESPONSE_CODE 消息,其中包含响应代码值 2(映射到“服务不可用”)。为什么我们会从最后一条消息中收到错误消息?我们正在使用静态项目 ID android.test.purchased,如果这有影响的话。

Android 日志消息是:

06-29 14:20:12.054:调试/iapReceive(21391):通知,notificationId android.test.purchased

06-29 14:20:12.054: DEBUG/iapSend(21391): 发送带有notificationId android.test.purchased 的GET_PURCHASE_INFORMATION

06-29 14:20:13.994: DEBUG/iapReceive(21391): inapp_signed_data 是 {"nonce":5454,"orders":[{"notificationId":"android.test.purchased","orderId":"transactionId. android.test.purchased","packageName":"com.shinyandroid","productId":"android.test.purchased","purchaseTime":1309382399381,"purchaseState":0}]}

06-29 14:20:13.994: DEBUG/iapReceive(21391): 购买状态改变,notificationId android.test.purchased,SKU android.test.purchased

06-29 14:20:13.994: DEBUG/iapSend(21391): 发送带有notificationId android.test.purchased 的CONFIRM_NOTIFICATIONS

06-29 14:20:14.845: DEBUG/vending(18344): [51] RequestRunnable.run(): Got ApiException from async request: Error from backend. 请求=com.android.vending.model.AckNotificationsRequest,响应=BAD_REQUEST

06-29 14:20:16.104: DEBUG/vending(18344): [51] RequestRunnable.run(): GotApiException from async request: Error from backend. 请求=com.android.vending.model.AckNotificationsRequest,响应=BAD_REQUEST

06-29 14:20:18.274: DEBUG/vending(18344): [51] RequestRunnable.run(): Got ApiException from async request: Error from backend. 请求=com.android.vending.model.AckNotificationsRequest,响应=BAD_REQUEST

06-29 14:20:20.824: DEBUG/vending(18344): [51] RequestRunnable.run(): Got ApiException from async request: Error from backend. 请求=com.android.vending.model.AckNotificationsRequest,响应=BAD_REQUEST

06-29 14:20:26.854: DEBUG/vending(18344): [51] RequestRunnable.run(): Got ApiException from async request: Error from backend. 请求=com.android.vending.model.AckNotificationsRequest,响应=BAD_REQUEST

06-29 14:20:26.854: WARN/vending(18344): [51] AsynchInAppAckNotifications.onException(): InAppAckNotificationsRequest 上的服务器错误: com.android.vending.api.ApiException: 来自后端的错误。请求=com.android.vending.model.AckNotificationsRequest,响应=BAD_REQUEST

06-29 14:20:26.904:调试/iapReceive(21391):异步响应代码,requestId 5225550415890630760,responseCodeIndex 2

4

1 回答 1

1

已经有几个星期了,所以我不再 100% 确定我们做了什么来修复它,但我相信问题是用于签署我们上传(在测试模式下)到 Android 的应用程序的密钥不匹配市场和我们用来签署我们在手机上运行的应用程序的密钥。

于 2011-08-20T19:03:45.413 回答