UIAlertView enter Apple ID and IAP password

When I start testing my IAP, the system asks me for the apple id and password. There is a warning with ok and cancel buttons.

I need to process this button, because when I click the cancel button, I need to do some actions in the application.

Very important: the authorization dialog is not a warning about the purchase. I need to know how to handle this action in the application (for example, if the user clicks the cancel button and after this authorization dialog disappears)

+5
source share
2 answers

If you see only an authorization warning and not a purchase warning, it means that you are trying to restore purchases.

, :

- (void)paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedWithError:(NSError *)error;
+6

failedTransaction:

- (void)failedTransaction:(SKPaymentTransaction *)transaction
{
    if (transaction.error.code != SKErrorPaymentCancelled)
    {
        // error!
    }
    else
    {
        // this is fine, the user just cancelled
        [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
    }
}
+2

All Articles