Skip to main content
Question

willRenew behaviour on cancelled but still active subscription [iOS SDK]

  • July 11, 2025
  • 1 reply
  • 8 views

Forum|alt.badge.img

I was testing a scenario when the user is on a subscription (e.g. monthly) and decides to purchase a lifetime access while subscribed. In this scenario:

  1. user has their monthly subscription that lasts until 31Jul for example (let's assume today is 11Jul)
  2. user purchased lifetime access
  3. -hen user goes to the settings and cancels their subscription which is still valid until 31Jul but won't renew

Now I wanted to show a banner to the user that they must manually cancel their subscription (as far as I know we cannot do it on our own). For this I am checking the willRenew flag that I found inside the customerInfo.subscriptionsByProductIdentifier.

What I noticed though during testing in Sandbox that the willRenew flag is not updated and couldn't get a confirmation on RevenueCat's forum if it's just a Sandbox issue or it's also not reliable in Production.

I also considered using it together with the unsubscribeDetectedAt attribute, somehow like this:

let hasNotCancelledActiveSubscription = customer.subscriptionsByProductIdentifier.values.count(where: { $0.willRenew && $0.unsubscribeDetectAt == nil }) > 0

Anyone was in a similar situation before? How did you solve it?

1 reply

guilherme
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 82 replies
  • July 16, 2025

Hey ​@zdtorok ,

using unsubscribeDetectedAt is the recommended approach for detecting subscriptions that have been cancelled but are still active.

The willRenew flag can be delayed, which is even more noticeable during testing. This is due to how frequently these syncs with Apple happen when App Store Server Notifications aren't enabled.

So while technically accurate, it’s not timely unless server notifications are set up. As for your code snippet, it works because unsubscribeDetectedAt is a timestamp that reflects when RevenueCat detected the cancellation event and it’s explicitly meant for this use case.

For the most reliable, real-time behavior in Production, we recommend enabling App Store Server Notifications (V2). This ensures RevenueCat receives cancellation events from Apple immediately, without waiting for the next polling cycle.

NOTE: Be mindful of your current Restore Behavior setting and the limitations around having this enabled for certain types.

 

Using syncPurchases() can help during development or after login, but it does not guarantee receipt changes are reflected right away. Server notifications are the better long-term solution.

As for TestFlight and Sandbox renewal times, here’s a quick breakdown:

Subscription Duration Sandbox Renewal TestFlight Renewal
1 month 5 min 24 hours
3 months 10 min 24 hours
1 year 30 min 24 hours

 

NOTE: TestFlight renewals were updated in Dec 2024 to always occur every 24 hours, regardless of duration. More context in our TestFlight testing section.

 

I hope this extra context helps in understanding the overall behavior - that said, you should be confident in using unsubscribeDetectedAt - it's the right tool for detecting cancelled but still active subscriptions like in your scenario.

Best,


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings