Post

Replies

Boosts

Views

Activity

Reply to StoreKit2: .purchase() not working after expiry of subscription in app, but renewing in AppStore sandbox does...
Hi guys, In our case this behaviour was due to the fact that we still had some pending transactions in the queue. Remember to always finish all subscription transactions even if they are expired. We could reproduce it 100% with the following steps: Purchase a subscription, call finish() on the verified transaction that results from the purchase process. Wait for renewals. Don't call .finish() on any renewal transactions. Let the subscription expire. Try to purchase another subscription with the same id. Purchase flow will always return an expired transaction as a result for the purchase flow. Our fix was: Improve our transaction updates task to always finish subscription transactions, even if transactions are already expired (let's say you have monthly subscription and a user will open your app after 4 months, you need to call .finish on 3 expired transactions and 1 valid transaction). Make sure you finish all pending transactions belonging to a subscription before making a new purchase (this is for safety in case you missed finishing a pending transaction or the transaction update comes with a delay). Note: We only had 2 days of testing and we couldn't reproduce the issue anymore in the Sandbox environment. We'll keep you updated if anything changes. Hope it helps! Cheers!
Jul ’23