0

Is there a possibility to check, if the user has canceled the subscription. I want to display to the user, when the subscription will be renewed, if it is not canceled.

MiWe
  • 113
  • 4

1 Answers1

0

If you are using the RevenueCat purchases_flutter package then the expiration date of the subscription is available from customerInfo.entitlements.all[<EntitlementId>].expirationDate.

(My variable names but you get the idea)

This is the definitive end date for the entitlement and should always be correct irrespective of if the customer has cancelled their subscription or not.

When the user cancels their subscription, the expiration date is not necessarily the date of the cancellation as there is usually a period remaining. It depends on the rules of the store. RevenueCat stays current with those rules and hence the expiration date should always be correct.

This is the value I use to show my users when their subscription will expire.

GrahamD
  • 2,952
  • 3
  • 15
  • 26
  • I use purchases_flutter. But the expirationDate has not the information I search for. I want to display to the user this: if (subscription.isCanceled) "subscribtion ends on " + expirationDate else "subscribtion renew on " + expirationDate But I don't find the isCanceled – MiWe Dec 14 '22 at 07:38
  • I didn't say that there was an isCancelled, there is an expiration date as explained above. You need to decide how to use that to achieve what you want. – GrahamD Dec 14 '22 at 09:24
  • This page tells you all the available attributes of the subscription: https://www.revenuecat.com/docs/customer-info – GrahamD Dec 14 '22 at 09:35
  • does this mean that there is no way to check if the subscription has been canceled? I hoped unscubscribeDetectedAt is set, but it is always null – MiWe Dec 14 '22 at 13:38
  • That would only tell you when the user decided to unsubscribe. I think you are missing the point that the expiry date is THE definitive date for the end of the subscription, nothing else matters. – GrahamD Dec 14 '22 at 18:47
  • I understand what the expirationDate is. I want to know what will happens on this date. "End of subscription" or "a new automatic payment". And I can't find any property that gives me this information. The expiration date has the same value indifferent the subscription is canceled or not. – MiWe Dec 14 '22 at 19:44
  • What want and what you can have are often not the same. Good luck. – GrahamD Dec 14 '22 at 20:29