Show Apple's description.
Learn the best practices for architecting your subscription infrastructure using StoreKit and server-side logic. Find out about simple engineering techniques to keep your subscribers longer, and how to utilize new tools and APIs to give your subscribers the best experience.
1. Device and Server Architecture
1. Receive Transaction
2. Verify Authenticity
App Store Receipt
It's a trusted record of App and In-App purchases, stored on device, issued by the App Store.
It's for your app, on that device only.
On-device vs Server-to-server.
- Don't use online validation directly from the device. - Request from Apple - Send binary receipt data to your own server. - The server send it to Apple Server to get it verified or not.
3. Update Subscription Status
orignaltransactionid -> user’s subscription ID
Does user have active subscription?
- Filter transactions by originaltransactionid
- Find the transaction with latest expiresdate (sort transactions by expiresdate)
- Date in the past shows user not active subscribed.
- Date in future shows user active
Discover new transactions directly from your server.
- Save latest version of encoded receipt data on your serer(latestReceiptData, exclude-old-transactions: true) - Treat receipt data like a token - /verifyReceipt response also includes new transactions - Located in the latestreceiptinfo field - Unlock new subscription periods without waiting for app to launch
New transactions will still appear in StoreKit on next app launch - Must verify and finish these transactions - Even if your server already knows about them - Opportunity to update latest receipt data on server
Reacting to Billing Issues
- Observe no renewal transaction appears
- Direct user to amend their billing details
- Unblock user immediately when transaction occurs
2. In-App Experience
- Creating User Accounts
- Introductory Pricing
- Upgrade/Downgrade Subscriptions
- Subscription Management
3. Reducing Subscriber Churn
- Involuntary churn
- Voluntary churn
- Leverage subscription specific receipt fields
- Implement status polling
- Implement customer messaging
- Present contextual subscription offers
- Server side state management offers more flexibility
- Use notifications from the App Store
- Offer introductory pricing
- Reduce churn with simple messaging
- Win back users with alternative subscription options
- New reporting tools in App Store Connect
This note was originally published at