MKStoreKit how to change the purchase confirm dialog title
I am using in-app purchase to buy a set audiobooks.
I am using MKStoreKit wrapper for in-app purchase. my products are of non consumable type.therefore bought only once. However whenever i press the buy button the message "Do you want to buy one {audiobook name} for {price}" . how to change this message?if any one has used MKStoreKit, how to know if the purchase is completed.(I need to开发者_JS百科 change the title of button only if the purchase is complete).
I'm not really sure, but I think you can't customize this alert, it's specific to Apple. And about how to know if the purchase is completed, I suggest you to take a look at this website, and specially at this method :
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
for (SKPaymentTransaction *transaction in transactions)
{
switch (transaction.transactionState)
{
case SKPaymentTransactionStatePurchased:
[self completeTransaction:transaction];
break;
case SKPaymentTransactionStateFailed:
[self failedTransaction:transaction];
break;
case SKPaymentTransactionStateRestored:
[self restoreTransaction:transaction];
break;
default:
break;
}
}
}
You also have to call this before ( again, take a look on the website above ) :
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
When the transaction.transactionState is SKPaymentTransactionStatePurchased, this means that the transaction is completed.
Hope it helps
精彩评论