I tried to post a reply to a thread. It seems to be posted, but does not appear in the thread once sent…
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
If an app is rated 4+, does it have any additional obligation due to the SB2420 beyond this rating on the AppStore ?
I'm struggling to implement required code for SB2420 compliance.
I try to learn on a very simple use case.
the app is UIKit
Build in Xcode 26.2
it displays a single Hello view with a button that will simply show a "Good day" label.
I assume the app will be rated 4+.
I tried the following code, using available information in Xcode (limited):
import UIKit
import DeclaredAgeRange
// other import needed ?
class ViewController: UIViewController {
@IBOutlet weak var welcomeLabel: UILabel! // initially hidden
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
func testAgeRange() -> Bool {
if !isEligibleForAgeFeatures { // Not found. Which import needed ?
return true // Not called from Texas
}
// Following code from Xcode doc…
do {
let response = try await AgeRangeService.shared.requestAgeRange(ageGates: 13, 15, 18) // Compiler Error: Missing argument for parameter 'in' in call
// Can I add the 4 gate ?
guard let lowerBound = response.lowerBound else {
// Allow access to under 13 features.
return false
}
var ok = false
if lowerBound >= 18 { // Not needed ?
// Allow access to 18+ features.
ok = true
} else if lowerBound >= 15 { // Not needed ?
// Allow access to 15+ features.
ok = true
} else if lowerBound >= 13 { // Not needed ?
// Require parental consent ?
// Allow access to 13+ features.
ok = true // if consent OK
} else {
// Require parental consent ?
// Show age-appropriate content
ok = true // if consent OK
}
return ok // Authorized for all 4+
} catch AgeRangeService.Error.notAvailable {
// No age range provided.
return false
}
}
func executeStart() {
welcomeLabel.isHidden = false
}
@IBAction func start(_ sender: UIButton) {
if #available(iOS 26.0, *) {
if testAgeRange() {
// Need to test for parental control here ?
} else {
// Alert and exit the app ?
}
} else {
// do nothing ? Can we run the app ?
}
executeStart()
}
}
The logic would be:
before allowing action with the start button, check
is it IOS 26+ so that we can call API
if so, is verification needed (Texas SB2420)
if not, we can proceed
if required, test age range
As app is 4+, all ranges should be OK
But need to test parental control
Now, many pending questions in code:
line 14: get an error: Cannot find 'isEligibleForAgeFeatures' in scope
line 19: I used the documentation sample for AgeRangeService, but get a Compiler Error: Missing argument for parameter 'in' in call
line 35: how to implement parental control ?
In addition, in the metadata of the app, should I declare that parental control ?
Age verification?
Mechanism for confirming that a person's age meets the age requirement for accessing content or services
As there is no restriction on age, is it required ?
Any help welcomed as well as link to a comprehensive tutorial.
Since recently, when I try to close a thread I created on an answer of mine, I get the following error:
Trying later, next day, does not solve it. In the list of all threads, the post is not marked as answered.
But if I look via Chrome or plain Safari, I see the answer itself is marked as correct:
Which is not the case when opening in Safari Technology Preview (Release 233) where the same answer is still to be accepted: