Hello everyone
I'm implementing age verification in my app to comply with upcoming age assurance laws (Utah, etc.), and I'm using AppStore.ageRatingCode from StoreKit to retrieve my app's current age rating.
According to the documentation:
extension AppStore {
@available(iOS 26.2, macOS 26.2, tvOS 26.2, watchOS 26.2, *)
public static var ageRatingCode: Int? { get async }
}
"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."
However, calling this always returns 0 in my environment.
Environment:
- Device: Real physical device (not simulator)
- iOS version: 26.4
- Sandbox Apple Account: signed in via Settings → Developer → Sandbox Apple Account
- App Store Connect: app is registered and age rating is configured
- Xcode Scheme → Run → Options → StoreKit Configuration: None
Code:
func getAgeRatingCode() async -> Int? {
guard let ageRatingCode = await AppStore.ageRatingCode else {
print("Age rating code unavailable")
return nil
}
print("ageRatingCode: \(ageRatingCode)") // always prints 0
return ageRatingCode
}
Questions:
-
What integer values does
ageRatingCodemap to? (e.g., does4+=4,9+=9,13+=13, etc.? Or is it a different internal code?) This mapping is not documented anywhere I can find. -
Is
0a valid return value, and if so, what does it represent? -
Is there a known issue with this API returning
0even when all conditions appear to be correctly configured?
Any guidance from Apple engineers or developers who have successfully used this API would be greatly appreciated.