Reputation: 7717
I would like to be able to READ some of the parental control settings, and use those values as the default setting for our application's setting screen. Our app has a menu showing movies are available for purchase; including an adult section. (Movies are beamed to the TV not played in the app.) The movie thumbnails are "safe" but risque, and of course the movie descriptions... Well, no child needs to know what the babysitter does after dark.
On iOS devices, users may set up content restrictions via: Settings -> General -> Restrictions -> ... I'm particularly interested in Restrictions -> Movies and Restrictions -> TV Shows; where parents can set check-marks next to each rating if it will be permitted:
I don't want to change those settings, only read their current value in an officially supported way. I've searched around, and can't seem to find the right APIs. Obviously, we'd rather not show all content if the user has taken the time to setup some parental controls.
PS: Please don't tell me Apple will reject the app.
Upvotes: 16
Views: 2299
Reputation: 23
Parental control settings can be read with UserDefaults
UserDefaults.standard.object(forKey: "com.apple.content-rating.TVShowRating")
The value of this object ranges from 0 to 1000.
Content rating keys that can be read:
com.apple.content-rating.ExplicitBooksAllowed
com.apple.content-rating.ExplicitMusicPodcastsAllowed
com.apple.content-rating.AppRating
com.apple.content-rating.MovieRating
com.apple.content-rating.TVShowRating
More about what the values mean can be seen in the
Apple developer documentation: Respecting Restrictions
Upvotes: 2
Reputation: 1
Your app is going to be rated whatever your highest level of content is.
So you'll not need to worry about this problem, as you will already be filtered out to all the kids with parental controls on Apps set.
Upvotes: 0
Reputation: 16725
Nope, unfortunately there's no API access to restrictions and parental controls.
Upvotes: 4