uploadAppleHealthArrayDataWithToken method
Implementation
Future<bool> uploadAppleHealthArrayDataWithToken(
String token,
List<Map<String, String>> data,
) async {
try {
final payload = {'externalUserId': 'NA', 'version': 2, 'data': data};
final _ = await dio.post(
'${Config.url}/custom-data/apple-health/upload-with-token',
data: payload,
options: Options(
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer $token',
},
),
);
return true;
} catch (e) {
return false;
}
}