Skip to content

feat(age-signals): add DECLARED status, ageRangeDeclaration, and SDK_VERSION_OUTDATED error#811

Merged
robingenz merged 8 commits into
mainfrom
feat/age-signals-declared-status
May 12, 2026
Merged

feat(age-signals): add DECLARED status, ageRangeDeclaration, and SDK_VERSION_OUTDATED error#811
robingenz merged 8 commits into
mainfrom
feat/age-signals-declared-status

Conversation

@robingenz
Copy link
Copy Markdown
Member

@robingenz robingenz commented Mar 28, 2026

Summary

  • Add DECLARED user status for Android (Play Age Signals API v0.0.3)
  • Add ageRangeDeclaration property to CheckAgeSignalsResult for iOS 26.2+ — exposes SELF_DECLARED, GUARDIAN_DECLARED, and CONFIRMED, mirroring Apple's simplified API direction (the six method-specific cases were deprecated by Apple and collapsed into confirmed in iOS 26.5)
  • Add SDK_VERSION_OUTDATED error code for Android
  • Bump androidPlayAgeSignalsVersion from 0.0.2 to 0.0.3
  • Tighten UserStatus.UNKNOWN and UserStatus.EMPTY docstrings to match Google's official semantics (resolves customer confusion about null vs UNKNOWN)
  • Replace ordinal-based mapUserStatus with explicit switch statement to decouple from enum ordering

Test plan

  • Verify Android build succeeds with Play Age Signals v0.0.3
  • Verify iOS build succeeds against Xcode 26.2+
  • Test DECLARED status is correctly returned on Android
  • Test ageRangeDeclaration is correctly returned on iOS 26.2+ (SELF_DECLARED, GUARDIAN_DECLARED, CONFIRMED)
  • Test null vs UNKNOWN user status produce distinct results on Android
  • Test SDK_VERSION_OUTDATED error code mapping on Android
  • Test fake manager supports DECLARED status and SDK_VERSION_OUTDATED error

Copilot AI review requested due to automatic review settings March 28, 2026 13:28
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 28, 2026

Open in StackBlitz

@capawesome/capacitor-age-signals

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-age-signals@811

@capawesome-team/capacitor-android-battery-optimization

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome-team/capacitor-android-battery-optimization@811

@capawesome/capacitor-android-dark-mode-support

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-android-dark-mode-support@811

@capawesome/capacitor-android-edge-to-edge-support

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-android-edge-to-edge-support@811

@capawesome-team/capacitor-android-foreground-service

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome-team/capacitor-android-foreground-service@811

@capawesome/capacitor-app-review

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-app-review@811

@capawesome/capacitor-app-shortcuts

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-app-shortcuts@811

@capawesome/capacitor-app-update

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-app-update@811

@capawesome/capacitor-apple-sign-in

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-apple-sign-in@811

@capawesome/capacitor-asset-manager

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-asset-manager@811

@capawesome/capacitor-background-task

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-background-task@811

@capawesome/capacitor-badge

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-badge@811

@capawesome/capacitor-cloudinary

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-cloudinary@811

@capawesome-team/capacitor-datetime-picker

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome-team/capacitor-datetime-picker@811

@capawesome-team/capacitor-file-opener

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome-team/capacitor-file-opener@811

@capawesome/capacitor-file-picker

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-file-picker@811

@capawesome/capacitor-formbricks

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-formbricks@811

@capawesome/capacitor-google-sign-in

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-google-sign-in@811

@capawesome/capacitor-libsql

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-libsql@811

@capawesome/capacitor-live-update

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-live-update@811

@capawesome/capacitor-managed-configurations

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-managed-configurations@811

@capawesome/capacitor-photo-editor

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-photo-editor@811

@capawesome/capacitor-pixlive

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-pixlive@811

@capawesome/capacitor-posthog

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-posthog@811

@capawesome/capacitor-realtimekit

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-realtimekit@811

@capawesome/capacitor-screen-orientation

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-screen-orientation@811

@capawesome/capacitor-screenshot

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-screenshot@811

@capawesome/capacitor-square-mobile-payments

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-square-mobile-payments@811

@capawesome/capacitor-superwall

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-superwall@811

@capawesome/capacitor-torch

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-torch@811

commit: 1a0f170

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new age-signal surface area to the @capawesome/capacitor-age-signals plugin to support the latest Play Age Signals SDK updates on Android and expose age range declaration metadata on iOS.

Changes:

  • Add UserStatus.DECLARED and ErrorCode.SDK_VERSION_OUTDATED to the public TypeScript API and update Android mappings/error handling accordingly.
  • Add ageRangeDeclaration to iOS CheckAgeSignalsResult (plus a new AgeRangeDeclaration enum) and include it in the JS payload when available.
  • Bump Android Play Age Signals dependency from 0.0.20.0.3 and document the new API surface.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/age-signals/src/definitions.ts Extends TS API with ageRangeDeclaration, DECLARED status, and SDK_VERSION_OUTDATED error code.
packages/age-signals/ios/Plugin/Enums/UserStatus.swift Adds DECLARED case to iOS-side user status enum.
packages/age-signals/ios/Plugin/Enums/AgeRangeDeclaration.swift Introduces iOS-side AgeRangeDeclaration enum for JS serialization.
packages/age-signals/ios/Plugin/Classes/Results/CheckAgeSignalsResult.swift Adds ageRangeDeclaration to iOS result object and JS conversion.
packages/age-signals/ios/Plugin/AgeSignals.swift Maps iOS ageRangeDeclaration from DeclaredAgeRange response when available.
packages/age-signals/ios/Plugin.xcodeproj/project.pbxproj Wires new Swift enum file into the Xcode project build.
packages/age-signals/android/.../enums/UserStatus.java Adds DECLARED to Android enum.
packages/age-signals/android/.../results/CheckAgeSignalsResult.java Replaces ordinal-based mapping with explicit integer-to-enum mapping.
packages/age-signals/android/.../options/SetNextAgeSignalsResultOptions.java Maps DECLARED to the SDK’s verification status for the fake manager.
packages/age-signals/android/.../options/SetNextAgeSignalsExceptionOptions.java Adds mapping for SDK_VERSION_OUTDATED error code in fake exceptions.
packages/age-signals/android/.../classes/CustomExceptions.java Defines SDK_VERSION_OUTDATED custom exception.
packages/age-signals/android/.../AgeSignals.java Maps status code 25010 to SDK_VERSION_OUTDATED.
packages/age-signals/android/build.gradle Bumps com.google.android.play:age-signals to 0.0.3.
packages/age-signals/README.md Updates dependency version docs and documents new TS API fields/enums.
.changeset/neat-bugs-move.md Adds a changeset entry for the new feature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/age-signals/src/definitions.ts
Comment thread packages/age-signals/README.md Outdated
Comment thread .changeset/neat-bugs-move.md
@robingenz robingenz self-assigned this Apr 29, 2026
@robingenz robingenz added feature Feature request package: age-signals platform: ios iOS platform platform: android Android platform labels Apr 29, 2026
Apple deprecated the six method-specific cases (`checkedByOtherMethod`,
`governmentIDChecked`, `paymentChecked`, and their guardian variants) and
replaced them with a single `confirmed` case in iOS 26.5. Mirror that
simplification in the plugin: expose only `SELF_DECLARED`,
`GUARDIAN_DECLARED`, and `CONFIRMED`, and map the deprecated iOS 26.2
cases onto `CONFIRMED`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@robingenz robingenz changed the title feat(age-signals): add DECLARED status, ageRangeDeclaration, and SDK_VERSION_OUTDATED error feat(age-signals): add status, , and error Apr 29, 2026
@robingenz robingenz changed the title feat(age-signals): add status, , and error feat(age-signals): add DECLARED status, ageRangeDeclaration, and SDK_VERSION_OUTDATED error Apr 29, 2026
@robingenz
Copy link
Copy Markdown
Member Author

Follow-up: handle Apple's new .confirmed case once Xcode 26.5 ships

This PR exposes CONFIRMED in the TS AgeRangeDeclaration enum and maps Apple's six (now-deprecated) method-specific cases onto it. However, Apple's new .confirmed case is not yet handled at the Swift switch level — the iOS 26.4 SDK shipped with Xcode 26.4.1 does not contain that case yet (it's iOS 26.5+, currently beta). Verified by reading the swiftinterface:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.4.sdk/System/Library/Frameworks/DeclaredAgeRange.framework/Modules/DeclaredAgeRange.swiftmodule/arm64e-apple-ios.swiftinterface

Adding case .confirmed: declaration = .confirmed against the 26.4 SDK fails with:

type 'AgeRangeService.AgeRangeDeclaration?' has no member 'confirmed'

Consequence today

On iOS 26.5+ devices, when Apple's runtime returns .confirmed, our switch falls through @unknown default → nil. The user gets ageRangeDeclaration: undefined instead of 'CONFIRMED'.

Action when Xcode 26.5 stable ships

  1. Update local Xcode to 26.5+.
  2. In packages/age-signals/ios/Plugin/AgeSignals.swift (around line 105–127), add:
    if #available(iOS 26.5, *) {
        case .confirmed:
            declaration = .confirmed
    }
    …or simply case .confirmed: declaration = .confirmed if Apple drops the availability gate by then.
  3. Run npm run verify:ios — confirm no warnings.
  4. No TS or docgen changes needed — Confirmed is already exposed.

References

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Comment thread packages/age-signals/ios/Plugin/Enums/UserStatus.swift Outdated
@robingenz robingenz merged commit 6892780 into main May 12, 2026
5 checks passed
@robingenz robingenz deleted the feat/age-signals-declared-status branch May 12, 2026 19:21
@github-actions github-actions Bot mentioned this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants