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
Due to Apple's Limitations on knowing the Read/Write permissions to Apple Health steps, I added a workaround to manually check the permission by writing a dummy data and deleting it, the return value is always false even though I made sure the value is available in Apple Health and being read normally
Steps to Reproduce
1 - Save a dummy data (0 steps) on a specified start and end date
2 - Read the dummy data using the same start and end date (confirm it is available)
3 - Delete the dummy data using the same start and end date
Expected Behavior
The delete function return type should be true and the value should be delete from Apple Health
Actual Behavior
The delete function return type is always false and the value is still available on Apple Health
Flutter Logs
No response
Screenshots
No response
Flutter Doctor Output
[✓] Flutter (Channel stable, 3.22.3, on macOS 15.0.1 24A348 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.95.3)
[✓] Connected device (4 available)
[✓] Network resources
Additional Information
No response
The text was updated successfully, but these errors were encountered:
I found a solution and found a bug. If you don't specify an end date inside the plugin, they use the same date, and Apple Health can't find a date to delete. Use a date like in my example, it works
BugFix:
final testWrite = DateTime.now();
final w = await health.writeHealthData(value: 1, type: HealthDataType.STEPS, startTime: testWrite);//w = true
final d = await health.delete(type: HealthDataType.STEPS, startTime: testWrite, endTime: DateTime.now());//d = true
A more correct way to fix the issue is to use different function in a swift side
Plugin Name
health
Plugin Version
11.1.0
Device
Iphone 13 pro max
Operating System
iOS 18.1
Describe the bug
Due to Apple's Limitations on knowing the Read/Write permissions to Apple Health steps, I added a workaround to manually check the permission by writing a dummy data and deleting it, the return value is always false even though I made sure the value is available in Apple Health and being read normally
Steps to Reproduce
1 - Save a dummy data (0 steps) on a specified start and end date
2 - Read the dummy data using the same start and end date (confirm it is available)
3 - Delete the dummy data using the same start and end date
Expected Behavior
The delete function return type should be true and the value should be delete from Apple Health
Actual Behavior
The delete function return type is always false and the value is still available on Apple Health
Flutter Logs
No response
Screenshots
No response
Flutter Doctor Output
Additional Information
No response
The text was updated successfully, but these errors were encountered: