mirror of
https://github.com/wger-project/flutter.git
synced 2026-12-02 10:09:11 +01:00
fix: request historical data access from Health Connect
Call requestHealthDataHistoryAuthorization() on Android after initial permission grant. Without this runtime request, Health Connect limits data access to the last 30 days regardless of the manifest permission. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -108,6 +108,11 @@ class HealthSyncNotifier extends _$HealthSyncNotifier {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Request access to historical data (older than 30 days) on Android
|
||||
if (Platform.isAndroid) {
|
||||
await _health.requestHealthDataHistoryAuthorization();
|
||||
}
|
||||
|
||||
await PreferenceHelper.instance.setHealthSyncEnabled(true);
|
||||
state = state.copyWith(isEnabled: true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user