uploadGoogleHealthConnectDataWithToken method
Implementation
Future<bool> uploadGoogleHealthConnectDataWithToken(
String token,
String data,
) async {
try {
final payload = {
'externalUserId': 'NA',
'version': 2,
'data': [data]
};
await dio.post(
'${Config.url}/custom-data/google-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;
}
}