flutter-plugins
flutter-plugins copied to clipboard
[Health] Expose additional methods for HealthFactory
- Added ability to open native settings for Health and Health connect apps on iOS & Android
- Added ability to checkAvailability of Health Connect at any time
Currently it was only checked in onAttachedToEngine plugin method (once on initialization). Then after the user downloaded Health Connect, it was impossible to refresh the Health Connect availability status.
Steps to reproduce the current behavior:
- Uninstall Health Connect
- Call
HealthFactory(useHealthConnectIfAvailable: true).requestAuthorization(...);
- it will fallback to Google Fit. - Download Health Connect
- Call
HealthFactory(useHealthConnectIfAvailable: true).requestAuthorization(...);
- it will fallback to Google Fit even tho we already have Health Connect.
This PR allows to call checkAvalability() before requesting permission so that we won't fallback to Google Fit when we actually have Health Connect installed