My iPhone app has in App purchasing. The app is a reference work and for very specialized chapters the user can purchase the extra text by tapping on a row in a UITableView which has the chapter title and the notation, "touch to unlock". This brings up an alert view. If the user taps YES the app goes out to the app store confirms payment, etc. via a series of alert view screens generated by Apple. This all works fine. At the end of the purchase, I want to update the table to unlock the text and replace "touch to unlock" with a chevron so that the user can access the text. No matter what I do I can't get the tableView to update via an update message to the tableView. If I bypass the app store but go through all the other steps to unlock the text, the identical message to update the table works fine.
The approved place to update the interface is in removedTransactions, always the last SKPaymentTransactionObserverProtocol delegate method called. I use this code
- (void)paymentQueue:(SKPaymentQueue *)queue removedTransactions:(NSArray *)transactions {
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
[stateTableViewController performSelectorOnMainThread:@selector(updateTableViewInterface) withObject:nil waitUntilDone:NO];
}
The network activity indictor shuts off but the updateTableViewInterface message is never received. [stateTableViewController updateTableViewInterface] doesn't work either.
I tried a variety of things and found the following weird result. If I send the update message to the table just before starting the app store paymentQueue, it gets sent to the table after the paymentQueue got started and just before the first Apple alertView "Do you want to buy..?" [useless of course since the payment hasn't been verified at this point]. Once I tap on buy, the message never gets sent, no matter where I put it in the payment chain.
It seems like the store kit is throwing away the update method somewhere in its chain of delegates calls but I can't figure out where or why.