extractAndPostData method
Future<SpikeWebhookJobDetails>
extractAndPostData(
- SpikeDataType<
SpikeData< type, {SpikeEntry> > - DateTime? from,
- DateTime? to,
Implementation
Future<SpikeWebhookJobDetails> extractAndPostData(
SpikeDataType type, {
DateTime? from,
DateTime? to,
}) async {
if (!Platform.isIOS && type == SpikeDataType.ecg) {
return emptyEcgWebhook(from, to);
}
await ensurePermissionsAreGranted(types: [type]);
final result = await NativeSDKBridge.extractAndPostData(
connectionId: connectionId,
dataType: type.toNativeDataType(),
from: from,
to: to,
);
ExceptionHandler.checkException(result);
final object = jsonDecode(result);
final jobDetails = SpikeWebhookJobDetails.fromObject(object);
return jobDetails;
}