I was able to successfully archive my main app that has a NotificationServiceExtension.
However, once I installed the app via Testflight, I was able to receive a notification, but the push notification modifications I did were not applied.
When I just ran it via Xcode, the push notification modifications worked.
Do I need to archive the NotificationServiceExtension instead of my main app?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Why are there unexpected transactions coming through the delegate method even after finishing the transaction?
The following is how I handle IAP transactions. I've read through multiple similar questions, but I couldn't fix it still and I don't fully understand why this is happening.
First, I finish all purchased, restored and failed transactions on init of my IAP manager. Therefore, this leaves me with 0 transactions.
I add self as observer on init (right after step 1), like so: SKPaymentQueue.default().add(self)
I add the payment to queue. This is triggered by user interaction.
Wait for callback on the following delegate method.
func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
switch transaction.transactionState {
case .purchased:
// This basically just persists the successful purchase somewhere. Once it's done, it returns a callback.
saveTransaction(transaction.transactionIdentifier) {
queue.finishTransaction(transaction)
}
case .failed, .restored:
queue.finishTransaction(transaction)
case .purchasing, .deferred:
break
@unknown default:
queue.finishTransaction(transaction)
}
}
The weird thing happens here. Even if I started with 0 transactions (step 1) and even after finishing the transactions for purchased, restored and failed states on updatedTransactions delegate (step 4), LOTS MORE of unknown transactions will come through updatedTransactions with the purchased status.
Even if I don't call saveTransaction and just directly finish transaction, I still receive all those unexpected transactions.
Where did those transactions even come from??