React Native Nitro Module to access Google Play's Age Signals API & Apple's Declared Age Range API
npm install react-native-play-age-range-declarationA 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+)
---
> [!IMPORTANT]
>
> - Works in both Expo & Bare (Non Expo) React Native projects.
> - Works well in both Android & iOS - Special thanks to https://github.com/luigiinred for helping out test on real Android & iOS devices to finalise the APIs.
> - Will start working properly from January 1st 2026, as mentioned by Apple & Google.
---
``bash`
npm install react-native-play-age-range-declaration react-native-nitro-modules
> [!NOTE]
>
> - The APIs for Apple's Declared Age Range and the android play age works in iOS 26 and in Android 15+ as I have tested in real device and I have attached a gif showing the workings of it.
| π iOS Demo | π€ Android Demo |
|---|---|
![]() | ![]() |
---
| Platform | API Used | Purpose |
| ----------- | ------------------------------------------------------------ | -------------------------------------------------- |
| Android | Play Age Signals API (com.google.android.play:age-signals) | Detect user supervision / verified status |AgeRangeService.requestAgeRange
| iOS | Declared Age Range API () | Get userβs declared age range (e.g., 13β15, 16β17) |
---
iOS: Add the below entitlement to your project:
com.apple.developer.declared-age-range
Android: No extra configuration needed, but for this API to work, you have to have play console installed in your android device.
---
> [!NOTE]
> iOS Only: setAgeRangeThresholds is only required for iOS. Android does not require this initialization.
Before using getIsConsideredOlderThan on iOS, or getAppleDeclaredAgeRangeStatus you must initialize the package by calling setAgeRangeThresholds with an array of age thresholds. This should include the different ages that gate content in your app
`tsx
import { setAgeRangeThresholds } from 'react-native-play-age-range-declaration';
setAgeRangeThresholds([13, 15]);
`
Requirements:
- First threshold is required
- Values must be between 1 and 18 (inclusive)
- Values must be in ascending order
- Values must be at least 2 years apart
Examples:
`tsx`
setAgeRangeThresholds([13]); // Single threshold at 13
setAgeRangeThresholds([13, 15]); // Two thresholds at 13 and 15
setAgeRangeThresholds([13, 15, 17]); // Three thresholds at 13, 15, and 17
> [!WARNING]
> iOS Permission Re-prompt: If you change the age thresholds after the user has already granted permission, iOS will re-prompt the user for permission. It's recommended to set the thresholds once at app startup and keep them consistent.

Use getIsConsideredOlderThan to check if a user is allowed to access age-gated content. This function works on both iOS and Android and returns true if the user is considered older than the specified age.
`tsx
import { getIsConsideredOlderThan } from 'react-native-play-age-range-declaration';
// Check if user is older than 18
const canAccessGatedContent = await getIsConsideredOlderThan(16);
if (canAccessGatedContent) {
// Show 16+ content
} else {
// Show age restriction message
}
`
Behavior:
- Returns true if the user is not in an applicable region where we are legally required to show the age verification prompttrue
- Returns if the user is older than or equal to the specified agetrue
- Returns if the user has parental approval to view contentfalse
- Returns in all other cases
Example: Gating content based on age
`tsx
const [isLoading, setIsLoading] = useState
const [canAccessContent, setCanAccessContent] = useState
const checkAgeRestriction = async () => {
const getIsConsideredOlderThan18 = await getIsConsideredOlderThan(18);
setCanAccessContent(getIsConsideredOlderThan18);
};
// In your component
{ !isLoading && checkAgeRestriction ? (
) : (
)}
`
`tsx
import { useState } from 'react';
import {
Text,
View,
StyleSheet,
ActivityIndicator,
ScrollView,
Platform,
Pressable,
} from 'react-native';
import {
getAndroidPlayAgeRangeStatus,
getAppleDeclaredAgeRangeStatus,
type PlayAgeRangeDeclarationResult,
type DeclaredAgeRangeResult,
PlayAgeRangeDeclarationUserStatusString,
getIsConsideredOlderThan,
setAgeRangeThresholds,
} from 'react-native-play-age-range-declaration';
setAgeRangeThresholds([13, 15]);
export default function App() {
const [androidResult, setAndroidResult] =
useState
const [appleResult, setAppleResult] = useState
null
);
const [isConsideredOlderThan18, setIsConsideredOlderThan18] = useState<
boolean | null
>(null);
const [isConsideredOlderThan15, setIsConsideredOlderThan15] = useState<
boolean | null
>(null);
const [isConsideredOlderThan13, setIsConsideredOlderThan13] = useState<
boolean | null
>(null);
const [error, setError] = useState
const [loading, setLoading] = useState(true);
const fetchStatus = async () => {
try {
setLoading(true);
setError(null);
if (Platform.OS === 'android') {
const data = await getAndroidPlayAgeRangeStatus();
setAndroidResult(data);
} else {
const data = await getAppleDeclaredAgeRangeStatus();
setAppleResult(data);
}
setIsConsideredOlderThan18(await getIsConsideredOlderThan(18));
setIsConsideredOlderThan15(await getIsConsideredOlderThan(15));
setIsConsideredOlderThan13(await getIsConsideredOlderThan(13));
} catch (err: any) {
console.error('β Failed to fetch Age Signals:', err);
const msg =
err?.message ??
err?.nativeStackAndroid ??
'Unknown error retrieving Play Age Signals';
setError(msg);
} finally {
setLoading(false);
}
};
const title =
Platform.OS === 'ios'
? 'Apple Declared Age Range Demo'
: 'Google Play Age Signals Demo';
return (
{loading ? (
) : error ? (
) : (
{Platform.OS === 'ios' ? (
Is Eligible: {appleResult ? String(appleResult?.isEligible) : ''}{' '}
{\n}\n
Status: {appleResult ? appleResult?.status : ''} {}\n
ParentControls: {appleResult
? appleResult?.parentControls
: ''}{' '}
{}\n
Lower Bound: {appleResult ? appleResult?.lowerBound : ''} {}
) : (
Is Eligible:{' '}
{androidResult ? String(androidResult?.isEligible) : ''} {\n}\n
Install Id: {androidResult ? androidResult?.installId : ''} {}\n
User Status:{' '}
{androidResult && androidResult.userStatus
? PlayAgeRangeDeclarationUserStatusString[
androidResult?.userStatus
]
: ''}
{'\n'}
Most Recent Approval Date:{' '}
{androidResult ? androidResult?.mostRecentApprovalDate : ''}
{''}
{}\n
Age Lower: {androidResult ? androidResult?.ageLower : ''} {}\n
Age Upper: {androidResult ? androidResult?.ageUpper : ''} {}\n
Error: {androidResult ? androidResult?.error : ''} {}
)}
{isConsideredOlderThan18 ? (
This is only visible to users older than 18
) : (
)}
{isConsideredOlderThan15 ? (
This is only visible to users older than 15
) : (
)}
{isConsideredOlderThan13 ? (
This is only visible to users older than 13
) : (
)}
)}
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 20,
backgroundColor: '#f4f6f8',
alignItems: 'center',
justifyContent: 'center',
},
header: {
fontSize: 20,
fontWeight: '700',
marginBottom: 20,
},
resultBox: {
maxHeight: 240,
width: '100%',
backgroundColor: '#fff',
borderRadius: 10,
padding: 12,
shadowColor: '#000',
shadowOpacity: 0.1,
shadowOffset: { width: 0, height: 2 },
shadowRadius: 6,
elevation: 2,
},
resultText: {
fontFamily: Platform.select({ ios: 'Menlo', android: 'monospace' }),
fontSize: 13,
color: '#333',
},
button: {
backgroundColor: '#2fe5e5',
borderRadius: 10,
padding: 12,
width: '100%',
justifyContent: 'center',
alignItems: 'center',
marginTop: 20,
},
buttonTitle: {
fontSize: 16,
fontWeight: '600',
color: 'black',
},
errorBox: {
backgroundColor: '#ffe5e5',
borderRadius: 10,
padding: 12,
width: '100%',
},
errorTitle: {
fontSize: 16,
fontWeight: '600',
color: '#b00020',
marginBottom: 4,
},
errorText: {
color: '#b00020',
fontSize: 14,
},
});
`
---
Both result types include an isEligible boolean field that indicates whether age-related features are available and applicable for the current user:
- true: The user is in a region where age verification is legally required.
- false`: The user is not in an applicable region, if isEligible is false we should be allow to let users view age gated content (Not verified by a laywer)
---
| Platform | Status |
| ----------------- | ----------------------- |
| Android | β
Supported (SDK Beta) |
| iOS 26+ | β
Supported |
| iOS Simulator | β οΈ Not supported |
| AOSP Emulator | β οΈ Not supported |
---
Pull requests welcome!
- Development Workflow
- Sending a PR
- Code of Conduct
---
MIT Β© Gautham Vijayan
---
Made with β€οΈ and Nitro Modules