我正在尝试获取我在InApp结算中所做的订单,但每次尝试它都会让我无效。在play.google.com中,我购买的商品是订单历史记录,但是当我在mPurchaseMap中签入时,它是空的。
我的方法:
@Override
public void onQueryInventoryFinished(IabResult result, Inventory inventory) {
if (result.isFailure()) {
Log.e("Android", "Problem getting inventory " + result.getMessage() + " code: " + result.getResponse());
} else {
Purchase premiumPurchase = inventory.getPurchase(Constants.SKU_PREMIUM_ACCOUNT);
if(premiumPurchase != null)
{
Log.e("Android", "User is premium");
SmokingUtils.changeToPremiuimAccount(getActivity());
}
else
{
Log.e("Android", "User is NOT premium");
}
}
}