Open phasedarray opened 8 years ago
yes, it's correct. That why , I use addTransactionObserver
at object allocate and removeTransactionObserver
at dealloc of IAPHelper class.
but at that time, _buyProductCompleteBlock is still nil, customer code can't get any notification or callback.
@saturngod From the Apple's document In-App Purchase Best Practices https://developer.apple.com/library/ios/technotes/tn2387/_index.html
Transaction observer SHOULD be added to SKPaymentQueue at application launch, the reason is that some transaction may be still in purchasing status when user closes the app. But IAPHelper doesn't initialise it self at launch. Moreover buyProductCompleteBlock in IAPHelper isn't initialised until buyProduct:onCompletion: or restoreProductsWithCompletion: is invoked. So the updatedTransactions will be lost before any purchase or restore if user relaunches the app.
Am i correct?