PBK - in response
You stated - "There is no documentation that moving from background to foreground will cause each transaction remaining in the queue to call updatedTransactions."
Response - this is correct and I'm trying to address this issue in the latest release of Developer Documentation. I think your reference above comes from another forum discussion posting. My intent was to state - "moving an application from the background to the foreground will trigger the transactionObserver to query the App Store queue for any incompleteTransactions pending for the applicationID and iTunes User. I can confirm this.
You then asked - "Can you confirm that StoreKit will call your observer's updatedTransaction method each time the app enters foreground with an active observer?"
Response - the transactionObserver will query the App Store, however, the updatedTransaction delegate method will only be called when there is an incompleteTransaction found.
You asked - "Can you confirm that StoreKit will call your observer's updatedTransactions method each time you execute an addTransactionObserver if there was no observer?"
Response - It's my understanding that calling addTransactionObserver when there is no active transactionObserver should result in a query to the App Store. What I think you are asking for verification - if an application calls addTransactionObserver, then later calls removeTransactionObserver, then the subsequent call to addTransactionObserver should result in a new query of the App Store. I've not seen this specific question answered by the StoreKit Engineering team. It would be easy to verify if one installs the StoreKit profile and captures the device console log when an app issues the sequence of calls to addTransactionObserver, removeTransactionObserver, addTransactionObserver. For each activation of the transactionObserver, there should be a request sent to the App Store - inAppCheckDownloadQueue. If the response is 1+, then the updatedTransactions delegate method is called.
What I have seen is that if an app calls addTransactionObserver more than once (without an intervening call to removeTransactionObserver), the subsequent calls to addTransactionObserver do not result in a check of the App Store.
The StoreKit engineering team design is that the addTransactionObserver call shall be made at application launch and that the removeTransactionObserver call shall be made in the applicationWillTerminate delegate method. You've indicated to me the utility of activating and deactivating the transactionObserver. If the mechanism of calling add/remove/addTransactionObserver does not do what is expected, I'd submit a bug report so that the issue can be documented and passed to the StoreKit engineering team.
You then asked about my statement - > There is no call to the updatedTransaction delegate method if the app is active at the time of purchase approval.
Are you sure of this? This is not the same response as in a purchase transaction. I'm surprised that they are different.
Response - in my complete response I thought I had stated that there are three instances that the transactionObserver is activated - maybe not in the response you reference
1. when addTransactionObserver is first called
2. when the app with the transactionObserver active transitions from the background to the foreground and
3. when an addPayment call is processed
I may have not have stated the third case in the response you referenced - which is my mistake.
rich kubota - rkubota@apple.com
developer technical support CoreOS/Hardware/MFI