User clicks on purchase button, the payment dialog pops up for iOS, if the user closes that dialog, I want set a gameobject to inactive. But I quite cant figure out which event is triggered for that case. I get the following in my log when user closes the dialog, but the OnPurchaseFailed is not called.
SKPaymentQueue: 0x3029505b0>: Payment completed with error: Error Domain=ASDErrorDomain Code=907 "(null)" UserInfo={client-environment-type=Sandbox, storefront-country-code=CAN, NSUnderlyingError=0x30249aac0 {Error Domain=AMSErrorDomain Code=6 "Payment Sheet Failed" UserInfo={NSLocalizedDescription=Payment Sheet Failed, AMSURL=https://sandbox.itunes.apple.com/WebObjects/MZBuy.woa/wa/inAppBuy?guid=00008120-000165093E98C01E, AMSStatusCode=200, AMSServerPayload={
"cancel-purchase-batch" = 1;
customerMessage = "Sign in with Apple ID";
dialog = {
cancelButtonString = Cancel;
defaultButton = Buy;
explanation = "Enter the password for %%appleId%% to authorize this transaction.\n\n[Environment: Sandbox]";
initialCheckboxValue = 1;
public void OnPurchaseFailed(Product product, PurchaseFailureReason failureReason)
{
Debug.LogError("FAILEDDDDDD");
purchaseInProgress = false;
SessionManager.Instance.waitPanel.SetPanelActive("Payment processing, please wait.",false);
Debug.Log($"Purchase failed - Product: '{product.definition.id}', PurchaseFailureReason: {failureReason}");
}