requestPermissions method
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;
}
}