Posts

Post not yet marked as solved
0 Replies
661 Views
I am trying to provide the required Restore feature in an app that has one non-consumable and 2 subscriptions levels. Everything seems to work but when I try to determine what has should be restored, the transaction only provides the latest transaction Id number, the original purchase identification and the original purchase date. So if the user has upgraded the app or made a second purchase, I have no way of determining what level the app should be restored to. The code below is similar to the Apple Development Example - https://developer.apple.com/documentation/storekit/in-app_purchase/offering_completing_and_restoring_in-app_purchases which has the same issue. Apple documentation states that this method restores all purchases. I seem to be missing something here? Doesn't it depend on the app to determine what should be restored and the only way to determine it is to look at the transaction detail. But the transaction detail only seems to have the info mentioned above which is not adequate when there is more than one purchase option?? Is there more information that can be had from the transaction? Or do I need to use a different method to determine it, like receiptValidation, which I have tried without any luck? extension StoreObserver: SKPaymentTransactionObserver {   /// Called when there are transactions in the payment queue.      func paymentQueue( queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {     for transaction in transactions {       switch transaction.transactionState {       case .purchasing: break       case .deferred: print(Messages.deferred)       // The purchase was successful.       case .purchased:         handlePurchased(transaction)       // The transaction failed.       case .failed: handleFailed(transaction)       // There're restored products.       case .restored: handleRestored(transaction)       @unknown default: fatalError(Messages.unknownPaymentTransaction)       }     }   }fileprivate func handleRestored( transaction: SKPaymentTransaction) {     hasRestorablePurchases = true     restored.append(transaction)     print("\(Messages.restoreContent) \(transaction.payment.productIdentifier).")     print("Tdate=",transaction.transactionDate ?? "not available" )     print("Odate=",transaction.original?.transactionDate ?? "not available" )     print("transID=",transaction.transactionIdentifier ?? "not available" )     //print("transID=",transaction ?? "not available" )     DispatchQueue.main.async {       self.delegate?.storeObserverRestoreDidSucceed()     }     // Finishes the restored transaction.     SKPaymentQueue.default().finishTransaction(transaction)       for transaction in restored {       print("\(Messages.restoreContent) \(transaction.payment.productIdentifier).")       print("Tdate=",transaction.transactionDate ?? "not available" )       } } }
Posted
by markv07.
Last updated
.
Post not yet marked as solved
1 Replies
695 Views
I recently updated both my Mac and Xcode version (now 11.6). When I open a large App I created I get 14 errors (Failed to render and update auto layout status for ..VC (code): The agent threw an excepetion) and about the same number of View Controllers have black backgrounds in the storyboard. The app runs fine in the simulator with the proper gradient backgrounds. The strange this is that as I go in and out of the storyboard, the errors start go away and the black backgrounds change to gradients. If I close the code and then reopen it, the 14 errors keep returning. Is there anyway to fix this?
Posted
by markv07.
Last updated
.