cph-cachet / flutter-plugins

A collection of Flutter plugins developed by CACHET
551 stars 681 forks source link

[HEALTH 9.0.1] ERROR when i get steps data in iOS #916

Closed ImKeon closed 8 months ago

ImKeon commented 8 months ago

Device / Emulator and OS

Describe the bug

While calling the 'getTotalStepsInInterval' method, the error 'Error getting total steps in interval No data available for the specified predicate.

All step count related permissions are granted.

To Reproduce

I'm not sure, but this seems to be an issue with newer versions of iOS.

Attach the code you are currently using

HealthFactory health = locator<HealthFactory>();

var now = DateTime.now();
var midnight = DateTime(now.year, now.month, now.day);
int? steps = await health.getTotalStepsInInterval(
  midnight,
  now,
);

Flutter doctor

[✓] Flutter (Channel stable, 3.16.9, on macOS 14.2.1 23C71 darwin-x64, locale ko-KR) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2023.1) [✗] Cannot determine if IntelliJ is installed ✗ Directory listing failed [✓] VS Code (version 1.87.2) [✓] Connected device (3 available) [✓] Network resources

ImKeon commented 8 months ago

We've found that it works fine on iOS 17.2. There seems to be an issue with getting the step data using the method channel, so I would appreciate it if you could check it out.

ImKeon commented 8 months ago

I figured it out. I found this issue in iOS community (link : https://discussions.apple.com/thread/255459321?sortBy=best, https://discussions.apple.com/thread/255504369?sortBy=best). so i updated iOS version 17.3.1 to 17.4 after that i solved this issue.

ImKeon commented 8 months ago

So I closed this issue