Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SKPaymentQueue updatedTransactions method not being called after renewal

I have implemented auto-renewable subscriptions in my app. All works ok. The only thing is that method public func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) is not being called after auto-renewal occurs as it should according to docs to inform me that subscription was renewed. It is called only when I call SKPaymentQueue.default().restoreCompletedTransactions()

I know that it auto-renews only 5 times and than I have to create new sandbox user and I tried it few times.

In my AppDelegate I do call SKPaymentQueue.default().add(self) method.

Any ideas?

like image 833
Wojtek Avatar asked Sep 14 '25 13:09

Wojtek


1 Answers

After a subscription is successfully renewed, StoreKit adds a transaction for the renewal to the transaction queue. Your app checks the transaction queue on launch and handles the renewal the same way as any other transaction. Note that if your app is already running when the subscription renews, the transaction observer is not called; your app finds out about the renewal the next time the app is launched.

Source In-App Purchase Programming Guide: Working with Subscriptions

like image 123
Wojciech Nagrodzki Avatar answered Sep 17 '25 04:09

Wojciech Nagrodzki