I have an issue with the restoration of hosted in-app purchase content. Sometimes it works, and sometimes it doesn't work at all. My users are also reporting this issue.
I had a hard time trying to replicate it, but I managed to run into a situation when it happens.
Right now whenever I run the app on my Mac from Xcode, my store delegate is notified about two pending restoration transactions in the queue shortly after launch. And the following function is being called:
func provideContent(_ transaction:SKPaymentTransaction) {
if transaction.downloads.count > 0 {
GLXLogger.shared.addGeneralLog(format: "[STORE] starting download")
SKPaymentQueue.default().start(transaction.downloads)
}
I see the log message [STORE] starting download
so I know that this code is executed. And then nothing happens. updatedDownloads
is not called. I have verified that finishTransaction
is also not called so this cannot possibly be interrupting normal execution.
I am basically out of ideas as to what could be causing this problem. I know that this scenario has two pending restoration transactions, but I see no reason why it should lead to such a failure. It corresponds to what I see in the logs of some of my users. For them SKPaymentQueue.default().start(transaction.downloads)
is called followed by nothing happening.
I would appreciate if you could help me debug this by at least throwing some ideas as to what you think could be causing such weird behaviour.