25.12.2013 Views

In-App Purchase Programming Guide - Apple Developer

In-App Purchase Programming Guide - Apple Developer

In-App Purchase Programming Guide - Apple Developer

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Working with Subscriptions<br />

<strong>App</strong>s that use subscriptions have some additional behaviors and considerations. Because subscriptions<br />

incorporate an element of time, your app needs to have the appropriate logic to determine whether the<br />

subscription is currently active and what time periods the subscription was active in the past. Your app also<br />

needs to react to new and renewed subscriptions, and properly handle expired subscriptions. Figure 5-1 shows<br />

an example subscription timeline, including some of the complexities your app needs to handle.<br />

Figure 5-1<br />

Example subscription timeline<br />

Calculating a Subscription’s Active Period<br />

Your app needs to determine what content the user has access to based on the period of time the subscription<br />

was active. Consider, for example, a magazine that publishes a new issue on the first day of each month,<br />

following the timeline in Figure 5-1.<br />

On February 20, the user buys a one-month subscription. When the user buys the subscription, the issue that<br />

was published February 1 is delivered immediately. On March 20, the subscription is due to expire but<br />

automatically renews for another month. On April 20, the user chooses to let the subscription lapse. Finally,<br />

on May 17, the user resubscribes. At that time, the May issue is delivered immediately just as the February<br />

issue was for the original subscription.<br />

A total of three issues are available to the user at the end of this example—February, March, and May—as<br />

shown in Table 5-1.<br />

Table 5-1<br />

Timeline of a sample subscription<br />

Magazine issue<br />

January<br />

February<br />

User has access to content?<br />

No, subscription hasn’t started<br />

Yes, delivered when the user subscribed on February 20<br />

2013-10-22 | Copyright © 2013 <strong>App</strong>le <strong>In</strong>c. All Rights Reserved.<br />

34

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!