Search Unity

IAP debugging: Does "Reset" cancel a purchase in progress?

Discussion in 'PSM' started by skaarjslayer, Aug 19, 2014.

  1. skaarjslayer

    skaarjslayer

    Joined:
    Oct 10, 2013
    Posts:
    108
    Hey,

    So this is a question I have related to the IAP system for UnityForPSM. It seems that while you're simulating IAP in the editor, hitting "Reset" as the result for any process actually comes through as CommonDialogResult.OK. The only other possible outcomes for this enum are Aborted, Cancelled, and Error.

    My question is, does hitting "Reset" cancel the purchase on the InAppPurchaseDialog's side of things? My reason for asking is that I wanted to implement a system that displays in-game success or failure pop-ups depending on the outcome of an in-app purchase. A result of CommonDialogResult.OK after I've called InAppPurchaseDialog.Purchase() typically means that the IAP succeeded. However, if the Reset option shares the same common result, I can't implement a callback for a successful purchase without dealing with the fact that whenever I hit "Reset" after calling InAppPurchaseDialog.Purchase(), it will also confirm that the purchase was successful. In short, there isn't a way to differentiate between which button I've pressed.

    Of course, I know this doesn't really have any bearing on a master build since end-users won't ever have the option of hitting "Reset", but for debugging purposes it's kind of annoying and if it cancels an IAP on the dialog's side of things, I find it would make more sense that hitting "Reset" would either generate a CommonDialogResult.Cancelled result or have a unique result of its own.

    Or is there some reason I'm not seeing that it has to be this way?

    Thanks.