A React Native Nitro Module providing a unified API for age-appropriate experiences across platforms β bridging:
- π’ Google Play Age Signals API (Android)
- π΅ Apple Declared Age Range API (iOS 26+)
Built using the Nitro Modules framework by Margelo for high-performance, fully typed native integration.
Important
- The APIs for both Google & Apple's Age Signal & Declared Age Range are not responding with full required info as of October 2025.
- Once they are working as intended I will update according to their API changes
npm install react-native-play-age-range-declaration react-native-nitro-modulesNitro Modules autolink automatically β no manual steps required.
β Works with
- React Native 0.76+ (New Architecture)
- Expo Custom Dev Clients
- TypeScript
| Platform | API Used | Purpose |
|---|---|---|
| Android | Play Age Signals API (com.google.android.play:age-signals) |
Detect user supervision / verified status |
| iOS | Declared Age Range API (AgeRangeService.requestAgeRange) |
Get userβs declared age range (e.g., 13β15, 16β17) |
import { getAgeData } from 'react-native-play-age-range-declaration';
export default async function Example() {
try {
// Android β returns Play Age Signals
// iOS β opens Declared Age Range UI
const result = await getAgeData(16);
console.log('Age Range Result:', result);
} catch (err) {
console.error('Error fetching age range:', err);
}
}import type { HybridObject } from 'react-native-nitro-modules';
export interface PlayAgeRangeDeclaration
extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
getPlayAgeRangeDeclaration(): Promise<PlayAgeRangeDeclarationResult>;
requestDeclaredAgeRange(ageGate: number): Promise<DeclaredAgeRangeResult>;
}
export interface PlayAgeRangeDeclarationResult {
installId?: string | null;
userStatus?: string | null;
error?: string | null;
}
export interface DeclaredAgeRangeResult {
status?: string | null;
lowerBound?: number | null;
upperBound?: number | null;
error?: string | null;
}{
"installId": "abcd-1234-efgh-5678",
"userStatus": "SUPERVISED"
}{
"status": "sharing",
"lowerBound": 16,
"upperBound": 17
}Implemented in Kotlin using Nitroβs async promises:
val manager = AgeSignalsManagerFactory.create(appContext)
val request = AgeSignalsRequest.builder().build()
manager.checkAgeSignals(request)Wrapped in:
Promise.async {
suspendCancellableCoroutine { cont -> ... }
}No RCT_EXPORT_MODULE β pure Nitro interop.
Implemented in Swift using Nitro async promises and Appleβs Declared Age Range API:
let response = try await AgeRangeService.shared.requestAgeRange(
ageGates: intGate,
in: viewController
)Bridged via:
class PlayAgeRangeDeclaration: HybridPlayAgeRangeDeclarationSpec { ... }Comply with digital safety and age-appropriate design laws automatically:
- Android β Play Age Signals (COPPA & supervision data)
- iOS β Declared Age Range (Appleβs privacy-preserving age disclosure)
| Platform | Status |
|---|---|
| Android | β Supported (SDK Beta) |
| iOS 26+ | β Supported |
| Expo Custom Dev Client | β Supported via Nitro autolinking |
| AOSP Emulator |
- β Kotlin + Swift Nitro implementation
- β Cross-platform TypeScript definitions
- β Async Promise bridge
- π§ Add example app with Fabric UI demo
- π§ Add GitHub Actions auto-publish pipeline
Pull requests welcome!
MIT Β© Gautham Vijayan
Made with β€οΈ and Nitro Modules