Contains properties and methods to facilitate interactions between your app and the App Store.
Members (10)
get · iOS 26.2+
ageRatingCode
TypeScript
static get ageRatingCode(): Promise<(number) | null>
Swift declaration
static var ageRatingCode: Int? { get async }
The current age rating code for your app.
Use this property to fetch the age rating for your app and compare it with the last known age rating to check if it has changed.
The following is an example of getting the age rating for an app:
```swift
func getAgeRatingCode() async -> Int? {
guard let ageRatingCode = await AppStore.ageRatingCode else {
print("Age rating code unavailable")
return nil
}
return ageRatingCode
}
```
If your app's age rating has changed, consider informing parents or guardians by using the
[Significant Change API](https://developer.apple.com/documentation/PermissionKit/SignificantAppUpdateTopic).
- Returns: An integer representing the current age rating code, or `nil` if the
age rating is unavailable.
static get deviceVerificationID(): (string) | null
Swift declaration
static var deviceVerificationID: UUID? { get }
Identifies the current device to help detect fraud.
To verify a `Transaction` or `Product.SubscriptionInfo.RenewalInfo` is valid for
the current device:
* Append the lowercased UUID string representation of this property after the lowercased UUID
string representation of `deviceVerificationNonce`
* Compute the SHA-384 hash of the appended UUID strings
* Verify the SHA-384 digest is equal to the `deviceVerification` property
Display a merchandising view.
- Parameters:
- kind: The merchandising kind to merchandise.
- controller: The view controller to show the merchandising UI in proximity to.
- Returns: The result of the App Store merchandising presentation.
- Throws: A `StoreKitError`.
Displays a sheet in the window scene that enables users to redeem a subscription offer code that
you configure in App Store Connect
- Important: The resulting transaction from redeeming an offer code
is emitted in `Transaction.updates`. Set up a transaction
listener as soon as your app launches to receive new
transactions while the app is running.
- Note: On apps built with Mac Catalyst, this method will return an error on versions prior to macOS 15.0.
- Parameters:
- scene: The `UIWindowScene` used to display the offer code redemption sheet.
- Throws: `StoreKitError`
Presents a sheet that enables users to redeem subscription offer codes that you configure in App Store Connect.
- Parameters:
- viewController: The `UIViewController` that StoreKit uses to display the offer code redemption sheet.
- options: A set of ``RedeemOption`` values to configure the offer code redemption.
- Returns: A ``VerificationResult`` containing the ``Transaction`` that the redemption produces.
- Throws: ``StoreKitError`` if the system cannot present the sheet or the redemption fails.
static · iOS 15.0+
sync
TypeScript
static sync(): Promise<void>
Swift declaration
static func sync() async throws
Sync signed transaction and renewal info with the App Store.
StoreKit automatically keeps signed transaction and renewal info up to date, so this should only be
used if the user indicates they are missing access to a product they have already purchased.
- Important: This will prompt the user to authenticate, only call this function on user interaction.
- Throws: If the user does not authenticate successfully, or if StoreKit cannot connect to the
App Store.