Friday, April 5, 2024
HomeiOS Developmentios - Learn how to know buy is energetic or not on...

ios – Learn how to know buy is energetic or not on restore buy


on restoring the acquisition, I get all transaction IDs of the consumer. That is how I’m restoring the acquisition…

@IBAction func restorePurchasePressed(_ sender: UIButton) {
    activityIndicator.startAnimating()
    SKPaymentQueue.default().restoreCompletedTransactions()
}

func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
    
    for transaction in transactions {
        if transaction.transactionState == .restored {
            
            print("Transaction restored")
            print("Transaction id: (String(describing: transaction.transactionIdentifier))")
            
            if let tId = transaction.transactionIdentifier {
                transactionIds.append(tId)
            }
        }
    }
}

On this updatedTransactions I get all of the transactions energetic in addition to expired. My query is the best way to get solely energetic transaction IDs.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments