After reading some other posts on the subject I have not been able to find a solution to this issue. When a user buys a product (managed in my case) and then he/her cancels the purchase how can my game get notified about it? It seems the only solution would be query the product states every time the user runs the application but this will make really hard to revert all purchases he have made for example if he bought virtual currency.

How do you handle this?.

Thanks in advance.

没有正确的解决方案

其他提示

You can consume item using the following code

mHelper.consumeAsync(inventory.getPurchase("item_id"), 

mConsumeFinishedListener); and check consumption succeed or not here :

IabHelper.OnConsumeFinishedListener mConsumeFinishedListener =
 new IabHelper.OnConsumeFinishedListener() {
 public void onConsumeFinished(Purchase purchase, IabResult result) {
   if (result.isSuccess()) {
     // provision the in-app purchase to the user
    // you can mark here that item has been consumed so you can purchase it again
   }
   else {
     // handle error
   }
}
};
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top