◉RORK LABJP
●MCP — Rork now lets you add and manage your own MCP servers inside Plugins (11/21)●2.5 ROUTE — From 12/1, apps calling gemini-2.5-flash are routed to 3.5 Flash-Lite and billed at its rates (9 days left)●CHANNEL — Users report Android notification channel reads and writes failing in Expo Go●NEW — New: three clues to check before replying to a stuck-on-splash review●EXPORT — Export your projects before you downgrade or cancel a plan●SONNET 4.5 — Apps that call Sonnet 4.5 through the API should switch before it retires on 11/30●MCP — Rork now lets you add and manage your own MCP servers inside Plugins (11/21)●2.5 ROUTE — From 12/1, apps calling gemini-2.5-flash are routed to 3.5 Flash-Lite and billed at its rates (9 days left)●CHANNEL — Users report Android notification channel reads and writes failing in Expo Go●NEW — New: three clues to check before replying to a stuck-on-splash review●EXPORT — Export your projects before you downgrade or cancel a plan●SONNET 4.5 — Apps that call Sonnet 4.5 through the API should switch before it retires on 11/30
Articles/Business
⟐ Business/2026-11-17Intermediate

When Age Checks Fail on iOS 27, Sort the Errors Into Wait, Continue Without a Signal, or Fix

The three errors Apple added to the age range API in iOS 27 (onboarding not finished, ineligible account, network) still reach JavaScript without a code in expo-age-range. Here is a first implementation that sorts them into retry, no age signal, or developer bug without reading message strings, plus how to word each screen.

expo-age-rangeDeclared Age RangeiOS 275age verificationApp Store review6indie development45Rork620

I was going through the iOS 27 changes one evening when I noticed three new errors on the age range API: declinedOnboarding, invalidAccount, and network. The names are easy enough to read. What bothered me was that my own code had not decided, even in a single line, what to do when any of them showed up.

It turned out someone had just filed this exact problem as Expo issue #53549 on November 16. expo-age-range does not give the three iOS 27 cases their own error codes, so JavaScript cannot tell them apart. The issue was closed almost as soon as it was opened, and when I read the source on main on November 17, the three cases were still not mapped.

The first thing I want to say is that you don't have to wait for those codes. If you decide where each kind of error should go, the current version is already enough to ship something that holds up in review.

What reaches JavaScript today

Reading the iOS side of expo-age-range (AgeRangeModule.swift and AgeRangeExceptions.swift), here is what requestAgeRangeAsync can hand you. One more detail worth keeping in mind: on iOS earlier than 26, no prompt is shown at all, and the call resolves with lowerBound: 18, the same as an adult.

What you getcodeMeaning
User declined to shareERR_AGE_RANGE_USER_DECLINEDThe person chose not to share on the system prompt
Service not availableERR_AGE_RANGE_NOT_AVAILABLEFor example, not signed in to iCloud on the device or simulator
Invalid requestERR_AGE_RANGE_INVALID_REQUESTFor example, age gates less than 2 years apart
Three new iOS 27 casesnoneOnboarding not finished, ineligible account, network failure
No view controller / unknown responsenoneNo screen to present on, or a response shape the module doesn't know

The issue author splits the new cases into two meanings. network is temporary, so try again a little later. declinedOnboarding and invalidAccount mean no age signal is available for that account, so they belong on the same path as ERR_AGE_RANGE_NOT_AVAILABLE. I agree with that reading.

I started matching message strings, then stopped

If there's no code, match on the message — that was the line I started writing, checking whether message contained "network". But that text is just the Swift error turned into a string. Expo doesn't promise it, and nothing guarantees it stays the same across OS versions or device languages.

So I flipped the approach. Route the codes you know by name, and send everything without a code to "wait once and retry, then continue without a signal." Of the three new cases, only network can be rescued by a retry; for the other two, a retry just returns the same answer, so one extra attempt costs very little.

Sort what you can name; let what you can't name fall toward not blocking the person. That was the line I cared about most here.

A first version that routes each error

This function turns the result into one of four outcomes: proceed, retry after a wait, no age signal, or fix your code. In an app built with Rork (Expo), you can drop it next to the screen that triggers the age check.

import { requestAgeRangeAsync } from 'expo-age-range';
 
type AgeGateResult =
  | { kind: 'ok'; lowerBound: number | null; upperBound: number | null }
  | { kind: 'declined' }      // the person chose not to share
  | { kind: 'noSignal' }      // no age signal for this account or service state
  | { kind: 'bug'; code: string }; // malformed request; the developer fixes it
 
const NO_SIGNAL_CODES = new Set(['ERR_AGE_RANGE_NOT_AVAILABLE']);
 
function codeOf(e: unknown): string | null {
  // Native errors may carry a code, but the three iOS 27 cases do not
  const c = (e as { code?: unknown } | null)?.code;
  return typeof c === 'string' && c.startsWith('ERR_AGE_RANGE_') ? c : null;
}
 
const wait = (ms: number) => new Promise((r) => setTimeout(r, ms));
 
export async function checkAgeRange(threshold: number): Promise<AgeGateResult> {
  for (let attempt = 0; attempt < 2; attempt++) {
    try {
      const res = await requestAgeRangeAsync({ threshold1: threshold });
      return { kind: 'ok', lowerBound: res.lowerBound, upperBound: res.upperBound };
    } catch (e) {
      const code = codeOf(e);
      if (code === 'ERR_AGE_RANGE_USER_DECLINED') return { kind: 'declined' };
      if (code === 'ERR_AGE_RANGE_INVALID_REQUEST') return { kind: 'bug', code };
      if (code && NO_SIGNAL_CODES.has(code)) return { kind: 'noSignal' };
      // Uncoded errors land here (iOS 27 network / declinedOnboarding / invalidAccount, and others)
      if (attempt === 0) {
        await wait(3000); // a network failure often clears after a few seconds
        continue;
      }
      return { kind: 'noSignal' };
    }
  }
  return { kind: 'noSignal' };
}

Three notes on why it's written this way:

  • It never reads message. When Expo eventually adds codes for the three cases, you add them to NO_SIGNAL_CODES or narrow the retry by name, and nothing else changes.
  • One retry, a 3-second wait. Age checks tend to appear right after launch or just before a purchase, and looping makes someone stare at a spinner.
  • bug is not a path for users. It's a sign that your age gates need fixing, so send it to logs or a notification only you see during development.

One line of copy per destination

Once the destinations exist, the wording stops being hard. These are the three I put in my draft:

  • Retrying (before the second attempt fails): "Checking your age is taking a moment. You can try again."
  • No age signal: "We couldn't confirm your age, so we'll start with some features limited. You can check again any time in Settings."
  • Declined to share: no blame; continue the same way as no signal, and don't keep re-showing the prompt

What you limit when there's no signal depends on your app and on what the regions you ship to require. As an indie developer, I chose to guarantee first that the app can start in a limited state, and to work out the exact limits afterward. An app that freezes in front of a person hurts far more, both in review and in ratings.

How store age ratings themselves are decided connects to what I wrote in A share button alone is not a social media capability.

When you ask Rork, give it the destinations first

If you ask Rork's chat to add the age check, writing the destinations up front keeps the generated code from drifting. Here is the skeleton of the request I drafted:

Call the age check (requestAgeRangeAsync from expo-age-range) from a "Check my age" item in Settings.
Split the result four ways.
1. Success: save lowerBound and go to the normal screen
2. ERR_AGE_RANGE_USER_DECLINED: continue in limited mode; don't re-show the prompt automatically
3. ERR_AGE_RANGE_INVALID_REQUEST: don't show anything to the user; console.warn only
4. Anything else (including errors with no code): wait 3 seconds, retry once, then continue in limited mode
Do not branch on the error.message string.

That last line is insurance against the generated code taking the same "match the text" road I almost took myself. Saying what not to branch on, at request time, has been the cheapest way I know to avoid rework.

Two things to check on your machine before review

  1. Call it on a simulator that is not signed in to iCloud. You should get ERR_AGE_RANGE_NOT_AVAILABLE, and the app should move to the no-signal copy and limited mode.
  2. Set the age gates one year apart on purpose (for example, threshold1: 16, threshold2: 17). Confirm ERR_AGE_RANGE_INVALID_REQUEST stays out of the user's view and only shows up in your logs.

To be honest about the limits: I haven't reproduced the three new iOS 27 cases on a real device yet. The issue author says the same thing — their fix is based on Apple's documentation, not on observed errors. That's exactly why it helps to route uncoded errors toward not blocking anyone.

For the full set of steps before you publish, see What you have to do on Apple's side before publishing a Rork app. If review does push back, What to do when a Rork app is rejected on the App Store is a good place to start.

If you do one thing today, open the catch around your age check and look for any line that reads message. If you find one, you're already halfway done.

Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

⟐ Business2026-09-08
A Share Button Is Not a Social Media Capability. A Feed Makes 13+ Your Floor
The App Store age rating questionnaire now asks whether your app has social media capabilities, and answers become required in September 2026. Here is where Apple drew the line, why the under-13 escape hatch obliges you to read age ranges, and how that looks in an Expo app.
⟐ Business2026-08-25
I Split Rork and Claude Code by Who Owns the Build Environment
How to decide between Rork and a terminal coding agent using data from your own repository instead of impressions of generated code. Includes a script that counts which layer your maintenance work lands in, and a check that catches native settings silently disappearing on regeneration.
⟐ Business2026-05-10
What I Learned Letting Rork Prototype an Art App: Where to Delegate, Where to Hold the Line
A hands-on review of prototyping an art gallery app with Rork: how far it honors color temperature and negative space, seen from artist and developer perspectives.