checkAgeSignals method

  1. @override
Future<AgeSignalsResult> checkAgeSignals()
override

Checks the age signals for the current user.

Returns an AgeSignalsResult containing the verification status and any available age information.

On iOS, you must call initialize with age gates before calling this method.

Throws AgeSignalsException if an error occurs during the check.

Implementation

@override
Future<AgeSignalsResult> checkAgeSignals() async {
  try {
    final result = await methodChannel.invokeMethod<Map>('checkAgeSignals');
    if (result == null) {
      throw const AgeSignalsException('Received null result from platform');
    }
    return AgeSignalsResult.fromMap(Map<String, dynamic>.from(result));
  } on PlatformException catch (e) {
    throw _handlePlatformException(e);
  }
}