requestPermissions method

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

Checks if activity recognition is available

Implementation

@override
Future<bool> requestPermissions() async {
  try {
    final isAvailable = await isActivityRecognitionAvailable();
    if (!isAvailable) {
      return false;
    }

    final bool? result =
        await _methodChannel.invokeMethod('requestPermissions');
    return result ?? false;
  } on PlatformException catch (e) {
    if (kDebugMode) {
      print('Error requesting permissions: ${e.message}');
    }
    return false;
  }
}