StoreKit Free Trial Period

I'm offering a free trial period for each of four auto-renewable subscriptions.

Does anyone know the best way to detect whether a customer is still in the trial period, and to calculate the remaining trial days? I'm using Storekit 2.

I've seen vague answers about using the Transaction purchaseDate and expiry date, but the documentation is incredibly vage as to what those values actually represent when it comes to a free trial period. What does purchase Date actually mean when you're in a free trial?

Any help greatly appreciated.

Answered by endecotp in 792194022

In iOS 1.72 and newer, check transaction.offer.paymentMode == freeTrial, and then status.renewalInfo.willAutoRenew, then status.renewalInfo.renewalDate.

For a while I was confused because I thought the free trial was part of the first subscription period and the renewal date would be after e.g. 1 year. But no, the free trial its its own subscription period of e.g. 3 days.

I would not try to calculate how many days are remaining; just show the renewalDate. (Because: https://xkcd.com/2867/ )

Accepted Answer

In iOS 1.72 and newer, check transaction.offer.paymentMode == freeTrial, and then status.renewalInfo.willAutoRenew, then status.renewalInfo.renewalDate.

For a while I was confused because I thought the free trial was part of the first subscription period and the renewal date would be after e.g. 1 year. But no, the free trial its its own subscription period of e.g. 3 days.

I would not try to calculate how many days are remaining; just show the renewalDate. (Because: https://xkcd.com/2867/ )

StoreKit Free Trial Period
 
 
Q