how to restore purchases of subscription
Asked on 2025-09-02
1 search
To restore purchases of a subscription, you can use the StoreKit API provided by Apple. The process generally involves checking the user's purchase history and restoring any active subscriptions. Here are some key points from the WWDC sessions that might help:
-
StoreKit API: Use the StoreKit API to query the user's purchase history and restore any active subscriptions. This can be done by implementing the
restoreCompletedTransactions
method, which will reprocess all completed transactions for the user. -
Subscription Status: You can determine the customer's subscription status using the Subscription Status Task modifier introduced in iOS 17. This helps in understanding which subscriptions are active and need to be restored.
-
App Store Server Notifications: Utilize App Store server notifications to keep track of subscription status changes, such as renewals or cancellations, which can help in managing the restoration process.
For more detailed guidance, you might want to refer to the session titled "Explore App Store server APIs for In-App Purchase" from WWDC 2024, which covers the purchase lifecycle and subscription management. You can find more information in the chapter on Subscriptions and Offers.
If you need to implement specific features like promotional offers or win-back offers, the session "Implement App Store Offers" provides insights on configuring and supporting these offers in your app.

What’s new in StoreKit and In-App Purchase
Learn about the latest StoreKit API enhancements to help you deliver great In-App Purchase experiences to your customers. We’ll review new fields added to AppTransaction, Transaction, and RenewalInfo, and updates to In-App Purchase offer codes. We’ll also cover creating signed In-App Purchase requests using the App Store Server Library and updates to merchandising subscriptions using SwiftUI.

What’s new in StoreKit and In-App Purchase
Learn how to build and deliver even better purchase experiences using the App Store In-App Purchase system. We’ll demo new StoreKit views control styles and new APIs to improve your subscription customization, discuss new fields for transaction-level information, and explore new testability in Xcode. We’ll also review an important StoreKit deprecation.

Explore App Store server APIs for In-App Purchase
Learn how to leverage your server to build great In-App Purchase experiences with the latest updates to the App Store Server API, App Store Server Notifications, and the open source App Store Server Library. After a recap of current APIs, we’ll introduce updated endpoint functionality, new transaction fields, and a new notification type. We’ll also discuss best practices for the purchase lifecycle, delivering content, and targeting offers, so you can become a server power user.