setTransactionObserver method

void setTransactionObserver(
  1. SKTransactionObserverWrapper observer
)

Sets an observer to listen to all incoming transaction events.

This should be called and set as soon as the app launches in order to avoid missing any purchase updates from the App Store. See the documentation on StoreKit's -[SKPaymentQueue addTransactionObserver:].

Implementation

void setTransactionObserver(SKTransactionObserverWrapper observer) {
  _observer = observer;
  channel.setMethodCallHandler(handleObserverCallbacks);
}