I'm using StoreKit for implement purchacing in my app. My question is how can I hendle UIAlertView when IAP dialog appear. I need to process Cancel button. I need to know when I press cancel and notify my system about this. I need to process cancel button that on alert view that request my user and password data.
For example if user tap on cancel button it should invoke some callback method.
You can handle it in SKPaymentTransactionObserver
Something like this
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
for (SKPaymentTransaction *transaction in transactions)
{
switch (transaction.transactionState)
{
case SKPaymentTransactionStatePurchased:
break;
case SKPaymentTransactionStateFailed:
{
if (transaction.error.code == SKErrorPaymentCancelled)
{
//user cancelled purchase
}
}
break;
case SKPaymentTransactionStateRestored:
break;
default:
break;
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With