fetchExercise method
Api for fetching a single exercise from Polar H10 device. Requires polarFileTransfer
feature. This API is working for Polar OH1 and Polar Verity Sense devices too, however in those devices recording of exercise requires that sensor is registered to Polar Flow account.
- Parameters:
- identifier: Polar device id or device address
- entry: single exercise entry to be fetched
- Returns: Single stream
- success: invoked after exercise data has been fetched from the device. see
PolarExerciseEntry
- onError: see
PolarErrors
for possible errors invoked
- success: invoked after exercise data has been fetched from the device. see
Implementation
Future<PolarExerciseData> fetchExercise(
String identifier,
PolarExerciseEntry entry,
) async {
final result = await _channel
.invokeMethod('fetchExercise', [identifier, jsonEncode(entry)]);
return PolarExerciseData.fromJson(jsonDecode(result));
}