startTracking method
Future<bool>
startTracking({
- bool showNotification = true,
- bool useTransitionRecognition = true,
- bool useActivityRecognition = false,
- int detectionIntervalMillis = 10000,
- int confidenceThreshold = 50,
override
Starts tracking user activity
Implementation
@override
Future<bool> startTracking({
bool showNotification = true,
bool useTransitionRecognition = true,
bool useActivityRecognition = false,
int detectionIntervalMillis = 10000,
int confidenceThreshold = 50,
}) async {
try {
final Map<String, dynamic> arguments = Platform.isAndroid
? {
'showNotification': showNotification,
'useTransitionRecognition': useTransitionRecognition,
'useActivityRecognition': useActivityRecognition,
'detectionIntervalMillis': detectionIntervalMillis,
'confidenceThreshold': confidenceThreshold
}
: {};
final bool? result =
await _methodChannel.invokeMethod('startTracking', arguments);
return result ?? false;
} on PlatformException catch (e) {
if (kDebugMode) {
print('Error starting tracking: ${e.message}');
}
return false;
}
}