2 Replies
      Latest reply on Mar 9, 2020 9:06 AM by dkardell
      dkardell Level 1 Level 1 (10 points)

        Is subscription testing in the sandbox (development) broken?  I subscribed to a monthly subscription that I set up and I called finish yet when I call restore transaction it still shows up (and in fact if I subscribe again the next day I now have 2 in the queue)?

        • Re: subscription sandbox
          PBK Level 7 Level 7 (3,575 points)

          restoreCompletedTransactions will restore any previous purchased IAP.

          A purchase and a restoreTransactions will each generate a transaction in the queue.  These transactions will remain in the queue until you call finishTransaction on each transaction.

            • Re: subscription sandbox
              dkardell Level 1 Level 1 (10 points)

              This is my issue.  I have called finishTransaction and they still show up.

               

              extension IAPService: SKPaymentTransactionObserver {
                  func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
                      for transaction in transactions {
                          
                          print (transaction.transactionState.status(), transaction.payment.productIdentifier)
                          
                          switch transaction.transactionState {
                          case .purchasing: break
                              
                          default:
                              print ("calling finish on \(transaction.payment.productIdentifier)")
                              queue.finishTransaction(transaction)
                              print ("finish returned on  \(transaction.payment.productIdentifier)")
                          }
                      }
                  }
                  
                  func restorePurchaces () {
                      print ("restoring purchases")
                      
                      paymentQueue.restoreCompletedTransactions()
                  }
              }