Mitul Jindal
Mitul Jindal

Reputation: 620

How to check the units (days, weeks, months or years) of a subscription period in SKProductDiscount?

Apple documentation:

enter image description here

Here I am able to get the number of units. How do I check if these units are days, weeks, months or years?

I couldn't find anything in the apple documentation.

Upvotes: 1

Views: 1457

Answers (1)

Paulw11
Paulw11

Reputation: 114984

The subscriptionPeriod property is an instance of SKProductSubscriptionPeriod.

This class has two properties:

  • numberOfUnits
  • unit

The unit property has an enumeration value that you can use to determine whether numberOfUnits refers to days, weeks, months or years.

Upvotes: 5

Related Questions