executeAppleHealth method
Future<void>
executeAppleHealth(
- Database database,
- Preferences preferences,
- Http http,
- bool previousAccess,
Implementation
Future<void> executeAppleHealth(
Database database,
Preferences preferences,
Http http,
bool previousAccess,
) async {
await database.init();
final accessGranted = await preferences.getAppleHealthAccessGranted();
if (accessGranted || previousAccess) {
if (!accessGranted) {
await preferences.setGoogleHealthConnectAccessGranted(true);
}
await _getAppleHealthData(preferences, http);
await _syncAppleHealthData(database);
await _deleteOldAppleHealthElements(database);
}
}