DeclaredAgeRange.requestAgeRange returns .notAvailable despite Family‑Sharing child account (iOS 26.2, Xcode 26.2)

Hello — I’m integrating DeclaredAgeRange to check >=18 at app registration, but the API keeps returning AgeRangeService.Error.notAvailable. I’ve tried family sharing and sandbox age settings without success. Below is a minimal environment, the exact code I call, my concise questions, and the expected behaviour. I can attach Console logs and screenshots if helpful.

Environment

Xcode: 26.2 Device OS: iOS 26.2 on real device Capabilities: Declared Age Range capability enabled in Xcode entitlements Framework integration: DeclaredAgeRange framework imported/linked in the project App compiled and installed from Xcode using development provisioning profile Device main Apple ID: I attempted both (a) Family‑Sharing child account logged in as device main Apple ID and (b) sandbox App Store account age settings via Settings → App Store → Sandbox Account → Manage → Age Verification Minimal code I if #available(iOS 26.2, *) { #if canImport(DeclaredAgeRange) do { let response = try await AgeRangeService.shared.requestAgeRange(ageGates: 18, in: self) switch response { case let .sharing(range): // handle range case .declinedSharing: // handle declined @unknown default: // handle unknown } } catch let err as AgeRangeService.Error { if case .notAvailable = err { print("AgeRange notAvailable") } else { print("AgeRange other error: \(err)") } } catch { print("AgeRange generic error: \(error)") } #endif } Key questions (please answer briefly)

Must the device main Apple ID be a Family‑Sharing child account (created/managed by a parent) for DeclaredAgeRange to ever return .sharing? Or can the App Store “Sandbox Account → Age Verification” produce a shareable result for this API? If the device main Apple ID must be a family child account, is there any Apple-side flag/setting (server-side) that Apple support must enable for that Apple ID to be eligible for age sharing? Does App Store Connect / app metadata / age rating or entitlements require any special setting for DeclaredAgeRange to work in the sandbox/dev environment? Are there known region/locale constraints (e.g., device region must be US) that commonly cause .notAvailable? What Console/system logs should I capture and attach to help determine whether the request reaches Apple backend vs. is blocked locally? (exact log names/filters welcome) Is there a canonical sandbox test flow doc for family/parent flows DeclaredAgeRange that guarantees a working test sequence?

Please post exact code. The present code would not compile. Impossible to comment on incomplete code.

And please edit your comment with linefeeds. The present text is very hard to read.

You should also edit your code with code formatter

Closer to this, but some instructions still missing

        if #available(iOS 26.2, *) {
#if canImport(DeclaredAgeRange)
            do {
                let response = try await AgeRangeService.shared.requestAgeRange(ageGates: 18, in: self)
                switch response {
                    case let .sharing(range): break // handle range
                    case .declinedSharing: break // handle declined
                    @unknown default: break // handle unknown }
                }
            }
            catch let err as AgeRangeService.Error {
                if case .notAvailable = err {
                    print("AgeRange notAvailable")
                } else {
                    print("AgeRange other error: \(err)")
                }
            }
            } catch {
                print("AgeRange generic error: \(error)")
            }
            
#endif // canImport(DeclaredAgeRange)
        }
DeclaredAgeRange.requestAgeRange returns .notAvailable despite Family‑Sharing child account (iOS 26.2, Xcode 26.2)
 
 
Q