You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/health/CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,10 @@
1
+
## 12.2.0
2
+
3
+
* iOS: Add `deviceModel` in returned Health data to identify the device that generated the data of the receiver. (in iOS `source_name` represents the revision of the source responsible for saving the receiver.)
4
+
* Android: Add read health data in background - PR [#1184](https://github.com/cph-cachet/flutter-plugins/pull/1184)
5
+
* Fix [#1169](https://github.com/cph-cachet/flutter-plugins/issues/1169) where `meal_type` property in `Nutrition` was null always
Currently health connect allows apps to read health data in the background. In order to achieve this add the following permission to your `AndroidManifest.XML`:
Copy file name to clipboardExpand all lines: packages/health/lib/src/health_plugin.dart
+64Lines changed: 64 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -264,6 +264,70 @@ class Health {
264
264
}
265
265
}
266
266
267
+
/// Checks if the Health Data in Background feature is available.
268
+
///
269
+
/// See this for more info: https://developer.android.com/reference/androidx/health/connect/client/permission/HealthPermission#PERMISSION_READ_HEALTH_DATA_IN_BACKGROUND()
270
+
///
271
+
///
272
+
/// Android only. Returns false on iOS or if an error occurs.
'$runtimeType - Exception in isHealthDataInBackgroundAvailable(): $e');
283
+
returnfalse;
284
+
}
285
+
}
286
+
287
+
/// Checks the current status of the Health Data in Background permission.
288
+
/// Make sure to check [isHealthConnectAvailable] before calling this method.
289
+
///
290
+
/// See this for more info: https://developer.android.com/reference/androidx/health/connect/client/permission/HealthPermission#PERMISSION_READ_HEALTH_DATA_IN_BACKGROUND()
291
+
///
292
+
///
293
+
/// Android only. Returns true on iOS or false if an error occurs.
'$runtimeType - Exception in isHealthDataInBackgroundAuthorized(): $e');
304
+
returnfalse;
305
+
}
306
+
}
307
+
308
+
/// Requests the Health Data in Background permission.
309
+
///
310
+
/// Returns true if successful, false otherwise.
311
+
///
312
+
/// See this for more info: https://developer.android.com/reference/androidx/health/connect/client/permission/HealthPermission#PERMISSION_READ_HEALTH_DATA_IN_BACKGROUND()
313
+
///
314
+
///
315
+
/// Android only. Returns true on iOS or false if an error occurs.
0 commit comments