Hello!
We have a store using Unity’s IAP system that has been working fine so far, but now that our game is in QA we’re getting reports related to not handling correctly the different errors that can occur when there are problems executing the calls sent by Google when a product is being purchased.
The QA team has been using the Charles Proxy to use its breakpoints tool and interrupt the different kind of calls that Google sends during the purchase flow. These are the calls done after pressing the “Buy” button of the Google Play pop up or after the ConfirmPendingPurchase() method is used (the “commitPurchase” call would be one of them for example).
This generates different kind of errors such as causing a product to become unavailable for purchasing. When you try to purchase them again the error pop up that says “You already own this item” appears.
Sometimes I also get the following error log (I’ve hidden the code of the product so please disregard the sku identification):
08-29 18:18:42.402: I/UnityIAP(17019): Error consuming consuming sku com.xxx.xxx. 6:Error
08-29 18:18:42.403: I/UnityIAP(17019): onConsumeFinished:false
08-29 18:18:42.403: I/UnityIAP(17019): Error consuming sku sku com.xxx.xxx (response: 6:Error)
08-29 18:18:42.403: I/UnityIAP(17019): 6
We have tried to handle these errors when they occur, but we haven’t been able to find any event that is raised when the Unity IAP fails to consume the product.
My question is: does Unity IAP provide any event to catch and handle errors such as the ones described above? Especially in the case when the game fails to consume a product? The OnPurchaseFailed() event is either not called or is called but gives “Unknown” as a reason, which doesn’t give enough information in order to handle the issue.