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
The crash is probably because your resultsHandler is being called by HealthKit on one of its worker threads. At the moment, callbacks into Dart only work if they're called on the same thread that created the callback.
We're working on fixing it so that callbacks can be called from an arbitrary thread. You can follow the progress of that here: dart-lang/sdk#37022
If you can't wait for that feature to land, the workaround at the moment is to write your results handler in objective C, and then forward the result to the target isolate over a Dart_Port. This is how package:cupertino_http works.
@liamappelbe :
thank you for your response. I have a working code with method channel for accessing HealthKit in Swift. I wanted to write the code in Dart only.
Hello,
I'm trying to use ffi with ffigen to access HealthKit on iOS. I've included my
main.dart
andpubspec.yaml
files in this gist: https://gist.github.com/jeanantoine/28cc7ff1e9d08fe360e2a720b4be657cWhen I run my code, I get the following runtime error:
Can anyone help me understand what might be causing this error and how I can fix it?
Thank you!
The text was updated successfully, but these errors were encountered: