if (Consts.DEBUG) {
Log.d(TAG, "Parsing JSON object");
}
JSONObject jObject;
JSONArray jTransactionsArray = null;
int numTransactions = 0;
long nonce = 0L;
try {
jObject = new JSONObject(signedData);
// The nonce might be null if the user backed out of the buy page.
nonce = jObject.optLong("nonce");
jTransactionsArray = jObject.optJSONArray("orders");
if (jTransactionsArray != null) {
numTransactions = jTransactionsArray.length();
}
if (Consts.DEBUG) {
Log.d(TAG, "JSON Array has " + numTransactions + " transactions");
}
} catch (JSONException e) {
if (Consts.DEBUG) {
Log.d(TAG, e.getMessage());
}
return null;
}
我是否误解了RESTORE_TRANSACTIONS的目的?是不是应该通过onPurchaseStateChange返回经过验证的购买清单,就像REQUEST_PURCHASE一样?
答案 0 :(得分:0)
没关系,我必须仔细观察。 RESTORE_TRANSACTIONS用于与MANAGED产品ID一起使用。我正在购买UNMANAGED项目。
http://developer.android.com/guide/market/billing/billing_admin.html#billing-purchase-type