/// <summary> /// Removes an observer from the payment queue. /// /// If there are no observers attached to the queue, /// the payment queue does not synchronize its list of pending transactions with the Apple App Store, /// because there is no observer to respond to updated transactions. /// </summary> /// <param name="observer">The observer to remove.</param> public static void RemoveTransactionObserver(ISN_iSKPaymentTransactionObserver observer) { m_observers.Remove(observer); if (m_observers.Count == 0) { //we have no observer's atm, have to disable observation on a native side ISN_SKLib.API.SetTransactionObserverState(false); } }
/// <summary> /// Adds an observer to the payment queue. /// /// Your application should add an observer to the payment queue during application initialization. /// If there are no observers attached to the queue, the payment queue does not synchronize its list /// of pending transactions with the Apple App Store, /// because there is no observer to respond to updated transactions. /// /// If an application quits when transactions are still being processed, /// those transactions are not lost. The next time the application launches, /// the payment queue will resume processing the transactions. /// Your application should always expect to be notified of completed transactions. /// /// If more than one transaction observer is attached to the payment queue, /// no guarantees are made as to the order they will be called in. /// It is safe for multiple observers to call <see cref="FinishTransaction"/>, but not recommended. /// It is recommended that you use a single observer to process and finish the transaction. /// </summary> /// <param name="observer">The observer to add to the queue.</param> public static void AddTransactionObserver(ISN_iSKPaymentTransactionObserver observer) { m_observers.Add(observer); if (m_observers.Count == 1) { //we have atleas one observer atm, so let's enable observation on a native side ISN_SKLib.API.SetTransactionObserverState(true); } }