Providing age-rating appropriate content
Check for age-rating based content restrictions and enable people to request approval for apps with a rating beyond the maximum allowed for the device.
Overview
You can help create a browsing experience consistent with the device’s maximum allowed age rating. When a person tries to install an app that has an age rating beyond the maximum allowed for the device, present a framework-provided sheet that enables the person to request the approval of a parent or guardian to install the app. The sheet contains an Ask for Exception button, which when tapped, sends a message to the parent or guardian.
When the parent or guardian taps the message, a sheet displays with buttons to approve or decline the request.
Alternatively, if the request recipient is in the vicinity of the device, a follow-on pane for the request flow contains an Approve in Person button, which when tapped, approves the request after the parent or guardian authenticates with their Apple Account.
[Image]
Check for age-rating based content restrictions
When people browse apps on your alternative app marketplace, you can check the maximumAllowedAgeRating property for any age-rating based restrictions set for the device. By adjusting your presentation of content that’s rated higher than the maximum allowed for the device, you can create a more age-rating appropriate browsing experience. For example, you can omit articles or featured content for rating-restricted apps but still return rating-restricted apps in search results to allow someone to request an exception to install one.
When a person tries to install an app that has an age rating beyond the maximum allowed for the device, set the requestAgeException property to true, such as through the init(account:appleItemID:alternativeDistributionPackage:isUpdate:appShareURL:requestAgeException:) initializer. This presents the Ask for Exception sheet and queues the app as a pending age-rating exception request in the currentAgeExceptionRequests() list. The framework also throws MarketplaceKitError.cancelled, because it doesn’t install the app at this time.
If the app to install has an age rating beyond the maximum allowed for the device and your app fails to request an age-rating exception, the framework throws MarketplaceKitError.ratingRestricted. Conversely, if your app requests an age-rating exception by setting requestAgeException to true when it’s not needed, the framework throws MarketplaceKitError.ageRatingExceptionNotNeeded.
Show exception status and enable in-person approval
While an exception is pending, check the request status in the currentAgeExceptionRequests() property of the AppLibrary class. For apps that are pending an exception, you can show a Pending button rather than an Install button.
If a parent or guardian is present, enable a person to present the exception sheet again by calling the presentAgeExceptionApproveInPersonSheet() method of the AppLibrary.App class. For example, you can display an Approve Now button next to the pending app. The sheet contains an Approve in Person button which, when tapped, requires the parent or guardian to authenticate with their Apple Account before the system installs the app.
If your app calls presentAgeExceptionApproveInPersonSheet() when there’s no age-rating exception requests for the app in currentAgeExceptionRequests(), the framework throws MarketplaceKitError.missingAgeRatingExceptionRequest.