cph-cachet / flutter-plugins

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

[Health 10.2.0] When using configure(useHealthConnectIfAvailable: true) before calling runApp(), iOS shows a blank white screen #989

Closed bps-takumaodaki closed 4 months ago

bps-takumaodaki commented 5 months ago

Device / Emulator and OS

Device: iPhone SE2 (iOS 17.5.1)

Describe the Bug

When executing Health().configure(useHealthConnectIfAvailable: true) before runApp on iOS, the app starts with a blank white screen.

Steps to Reproduce

  1. Change the main function of the example app to the following:
void main() => runApp(HealthApp());

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Health().configure(useHealthConnectIfAvailable: true);
  runApp(HealthApp());
}
  1. Launch the app on an iOS device.

Result: The app starts with a blank white screen.

Screenshots

https://github.com/cph-cachet/flutter-plugins/assets/111839744/a2eb4de3-d2aa-4628-a1bc-e1b154b839d1

Additional Information

When useHealthConnectIfAvailable is set to true, a Method Channel API that is not implemented on the iOS side is being called.

drb1010 commented 4 months ago

we can use platform option in this case

yogeshButani commented 4 months ago

hi @drb1010 i have also used health package to get the steps data from health connect. On IOS devices it's working good, taking data from apple health successfully but when comes in android, its always showing 0 steps, i have all the setup for Android, even not getting any type of error still showing 0 steps don't know why...all permissions are enabled, app is also showing inside health connect settings on device...don't know how the issue is occurring... please help