Home iOS in-app purchase subscription get free trial period length from SKProduct

# iOS in-app purchase subscription get free trial period length from SKProduct

mjpablo23
1#
mjpablo23 Published in 2017-08-22 19:01:06Z
 I am working on in-app purchases with subscriptions. In swift, you can get price and price locale from the SKProduct like so: weeklyProduct.price.doubleValue weeklyProduct.priceLocale.currencySymbol  where weeklyProduct is a SKProduct. Is it possible to get the free trial length? For example, I specified a two week free trial for the product. can I get this from the SKProduct?
Garrett Cox
2#
Garrett Cox Reply to 2017-10-11 23:01:17Z
 Trial length is not included in the SKProduct information and will have to be hardcoded into the app or stored on your server. The only available option for deriving this type of information (currently) is from the receipt itself.
DanSkeel
3#
 Starting from iOS 11.2 you can get info about trials using introductoryPrice property of SKProduct. It contains instance of SKProductDiscount class, which describes all discount periods including free trials.