User.getDeclaredAgeRange
Functional API
getDeclaredAgeRangeYou can use the same feature with it as well.
Feature description
Retrieves the declared age range on iOS.
iOS only This is an API. It requires iOS 26 or later, and the Toss app iOS 5.266.0 It can only be used on iOS 26 or later — Android is not supported. Before calling User.getDeclaredAgeRange.isSupported()You can check whether it is supported with
Type
User.getDeclaredAgeRange(params: GetDeclaredAgeRangeParams): Promise<DeclaredAgeRange>;Params
interface GetDeclaredAgeRangeParams {
ageGates: number[];
}Response
interface DeclaredAgeRange {
status:
| "SHARING"
| "DECLINED_SHARING"
| "UNSUPPORTED_OS"
| "NOT_AVAILABLE"
| "INVALID_REQUEST"
| "FAILED";
lowerBound?: number;
upperBound?: number;
ageRangeDeclaration?: string;
activeParentalControls: string[];
isEligibleForAgeFeatures?: boolean;
errorCode?: string;
}Error
The error code is the error.code value.
UNSUPPORTED_OS_VERSION
If the device's OS is below iOS 26 or is not iOS, this occurs immediately upon calling. User.getDeclaredAgeRange.isSupported()Check in advance with error.messageShow the user the (OS update guidance message).
UNSUPPORTED_APP_VERSION
If the running version of the Toss app is below iOS 5.266.0, this occurs immediately upon calling. User.getDeclaredAgeRange.isSupported()Check in advance with error.messageShow the user the (Toss app update guidance message).
Example code
Was this helpful?