質問

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