Auto-renewable subscriptions: how many months?

Today I was confused by some problems:

1: Does the auto-renewal subscription last one month for 30 days or depends on the natural month?

Because I can only test in sandbox mode, so the duration is only a few minutes ... Perhaps Apple just calculates this as follows: 2013 \ 01 \ 15 → 2013 \ 02 \ 15 → 2013 \ 03 \ 15. If so, a second problem arises.

2: For example: I buy a monthly auto-renewal subscription in 2013 \ 03 \ 31, because 2013 \ 04 has only 30 days, what is expires_date of my subscribers? 2013 \ 04 \ 30 or 2013 \ 05 \ 01 or another date?

After a hard google search I can't find the answer ... sorry for my poor english ...

Thank.

+5
source share
1 answer

He adds 1 month, not 30 days. The number of days in 1 month varies. Thus, a subscription purchase on 3/31 ends on 4/30.

You can use NSDate, NSCalendar, and NSDateComponents to add a month to the date and see how long it takes. Read more here: Change NSDate to represent 1 month from today

+2
source

All Articles