Repository navigation
Add opt-in isEligibleForAgeFeatures() for iOS 26.2+ - #36
Merged
zigapovhe merged 1 commit intoSep 22, 2026
Merged
Conversation
Exposes Apple's region eligibility check as a separate call, guarded by the same 10-second deadline as getRequiredRegulatoryFeatures(). checkAgeSignals() still does not call it. Throws UnsupportedPlatformException below iOS 26.2, on pre-26.2 SDKs and on Android so false always means Apple reports no obligation. Apple DTS confirms requiredRegulatoryFeatures can be empty while this is true (forums thread 815952), so pre-gating apps need both. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Owner
|
thanks for the PR, nicely done. code side is clean — verified the DTS empty-set answer and the forum reports against apple's docs before merging. two doc things I'm fixing in a follow-up commit (can't push to your branch, org forks ignore the maintainer-edit flag):
merging into the 0.10.0 release branch rather than main directly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
isEligibleForAgeFeatures()as an opt-in call, without changing howcheckAgeSignals()behaves.Why
requestAgeRange()shows its sharing sheet in every region, so an app that only wants to prompt people who are actually subject to age assurance needs a pre-check. Apple's guide still listsisEligibleForAgeFeaturesas the first step, andgetRequiredRegulatoryFeatures()does not cover it on its own: Apple DTS states that regulations added after iOS 26.4 may not map onto an existingRegulatoryFeature, so the set can be empty whileisEligibleForAgeFeaturesistrueand the obligation still stands. Apps that gate on region need both.The 0.6.0 reasons for dropping the internal pre-gate still hold, so this does not reintroduce it.
checkAgeSignals()is unchanged; the property is only reachable through the new method, and it runs under the samewithDeadlineas the regulatory call so a hang surfaces asApiErrorExceptionafter 10 seconds.API
Future<bool> isEligibleForAgeFeatures()onAgeRangeSignals, the platform interface and the method channel.UnsupportedPlatformExceptionbelow iOS 26.2, in apps built with a pre-26.2 SDK (samecompiler(>=6.2.3)guard as the other 26.2 symbols) and on Android, sofalsealways means Apple reports no obligation.AgeRangeService.Error.notAvailablemaps toApiNotAvailableException.llms.txtand acontext7.jsonrule under the 255 character limit. The example app gains a button next to the regulatory ones.Testing
flutter test(83 tests),flutter analyzeon the package and the example, anddart formatare clean.truewith an Age Assurance scenario selected andfalsewithout one, both well inside the deadline.truetofalsefor Brazil after 26.4 with no account change, so the README keeps the advice to treat it as an obligation signal with a caller-side fallback rather than a stable region flag.🤖 Generated with Claude Code