Retrieves the user's age range.
🚨 iOS: Native age verification only available on iOS 26+.
🚨 Android: Native age verification only available on Android SDK 23+.
Example:
let userIsAdult = false;
try {
const modules = await Eitri.modules()
if (!modules.ageVerification) {
// ageVerification module is unavailable
return
}
const ageRange = await modules.ageVerification.getUserAgeRange();
userIsAdult = (ageRange?.lowerBound ?? 0) >= 18;
} catch (error) {
console.log("getUserAgeRange.error: ", error);
}
- Module:
ageVerification- Install eitri-ios-age-verification or eitri-android-age-verification
Returns whether associated laws or regulations may apply to your app based on the person’s location and account settings.
Android will throw an error, as there is no native methods to determine this on Android.
- 🚨 iOS: Native age verification only available on iOS 26.2+.
try {
const modules = await Eitri.modules()
if (!modules.ageVerification) {
// ageVerification module is unavailable
return
}
let userIsAdult = false;
const isSubjectToAgeRegulations = await modules.ageVerification.isSubjectToAgeRegulations();
if (isSubjectToAgeRegulations) {
userIsAdult = (await modules.ageVerification.getUserAgeRange())?.lowerBound >= 18;
}
if (userIsAdult) {
// show age restricted content
}
} catch (error) {
console.log("isSubjectToAgeRegulations.error: ", error);
}
Generated using TypeDoc
Overview
Provides the ability to retrieve the user's age range through the native age verification system on iOS and Android. This allows apps to implement age-based content restrictions or features without directly handling sensitive age data.