requestAuthorization method

  1. @override
Future<bool> requestAuthorization()
override

Implementation

@override
Future<bool> requestAuthorization() async {
  try {
    final granted =
        await methodChannel.invokeMethod<bool>('requestAuthorization') ??
        false;
    return granted;
  } on PlatformException catch (e) {
    if (e.code == 'UNSUPPORTED_VERSION') {
      throw PlatformException(
        code: 'UNSUPPORTED_VERSION',
        message: 'AlarmKit is only available on iOS 26.0 and above',
      );
    }
    rethrow;
  }
}