I am going to implement StoreKit in an iPhone application and wanted to know if there is any experience out there already that could point out any pitfalls or traps in using StoreKit?
I know the API is new - but there is some premium content in my app that I would like to ask users to pay for and this seems an ideal way to do it - rather than directing them to a website for separate payment on their subscription.
I also assume there are guidelines for how you list an app in the app store to make clear that the app is free to install - but you must upgrade for certain functionality.
Can anyone recommend a good application that uses the StoreKit API that I might model the user interaction on?
Things to think about when implementing StoreKit:
When you call [[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
sometimes you get the (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue
callback before (and sometimes long before) the - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
call back. (Also sometimes transactions are missing.)
Sometimes when you add a purchase to the Queue with [[SKPaymentQueue defaultQueue] addPayment:payment];
the transaction is removed from the queue and the only feedback you get is: - (void)paymentQueue:(SKPaymentQueue *)queue removedTransactions:(NSArray *)transactions
User cancelations returns a wide variety of error messages and some error conditions return the SKErrorPaymentCancelled error code. Specifically:
Don't forget to implement other SKRequest callbacks:
- (void)request:(SKRequest *)request didFailWithError:(NSError *)error;
- (void)requestDidFinish:(SKRequest *)request