Contents

sync()

Synchronizes your app’s transaction information and subscription status with information from the App Store.

Declaration

static func sync() async throws

Discussion

Include some mechanism in your app, such as a Restore Purchases button, to let users restore their in-app purchases. In rare cases when a user suspects the app isn’t showing all the transactions, call sync(). By calling sync(), you force the app to obtain transaction information and subscription status from the App Store.

In regular operations, there’s no need to call sync(). StoreKit automatically keeps up to date transaction information and subscription status available to your app. When users reinstall your app or download it on a new device, the app automatically has all transactions available to it upon initial launch. There’s no need for users to ask your app to restore transactions — your app can immediately get the current entitlements using currentEntitlements and transaction history using all. For more information about transactions, see Transaction.