Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed (regression) issues with metric and permissions #462

Merged
merged 3 commits into from
Dec 29, 2021

Conversation

matsunanaro
Copy link

@matsunanaro matsunanaro commented Nov 21, 2021

This PR fixed regression issue #460 by using metric units for weight, height and body temperatures.

Please refer to issue #460 for more details.

@matsunanaro matsunanaro changed the title metric unit for weight, height and body temp. Hot fix: metric unit for weight, height and body temp. Nov 30, 2021
@matsunanaro matsunanaro changed the title Hot fix: metric unit for weight, height and body temp. Fixed (regression) issues with metric and permissions Dec 8, 2021
@matsunanaro
Copy link
Author

On top of the original issue, a commit was just added to

  • introduce a named optional parameter, "permissions", into the requestAuthorization method. If unspecified, only READ access will be requested by default.
  ///
  /// Requests permissions to access data types in the HealthKit or Google Fit store.
  ///
  /// Returns a Future of true if successful, a Future of false otherwise
  ///
  /// Parameters
  ///
  /// * [types] - a list of [HealthDataType] which the permissions are requested for.
  /// * [permissions] - Optional. 
  ///   + If unspecified, each [HealthDataType] in [types] is requested for READ [HealthDataAccess].
  ///   + If specified, each [HealthDataAccess] in this list is requested for its corresponding indexed 
  ///   entry in [types]. In addition, the length of this list must be equal to that of [types].
  ///
  • implement the hasPermissions method on both the iOS and Android platforms.
  /// Determines if the data types have been granted with the specified access rights.
  ///
  /// Returns: 
  /// 
  /// * true - if all of the data types have been granted with the specfied access rights.
  /// * false - if any of the data types has not been granted with the specified access right(s)
  /// * null - if it can not be determined if the data types have been granted with the specified access right(s).
  ///
  /// Parameters:
  /// 
  /// * [types]  - List of [HealthDataType] whose permissions are to be checked.
  /// * [permissions] - Optional. 
  ///   + If unspecified, this method checks if each HealthDataType in [types] has been granted READ access.
  ///   + If specified, this method checks if each [HealthDataType] in [types] has been granted with the access specified in its 
  ///   corresponding entry in this list. The length of this list must be equal to that of [types].
  /// 
  ///  Caveat:
  /// 
  ///   As Apple HealthKit will not disclose if READ access has been granted for a data type due to privacy concern,
  ///   this method can only return null to represent an undertermined status, if it is called on iOS
  ///   with a READ or READ_WRITE access. 
  /// 
  ///   On Android, this function returns true or false, depending on whether the specified access right has been granted.
  • fix some cosmetic issues on formatting documentation

This PR can therefore fix the following issues:

@matsunanaro matsunanaro mentioned this pull request Dec 8, 2021
@dkbast
Copy link

dkbast commented Dec 13, 2021

Is there anything blocking this PR? Im really looking forward to having this fixed and would volunteer for any additional work that needs to be done.

@paulhulatt
Copy link

Is there any ETA on when this PR will be merged?

@bardram bardram merged commit 6d81fbd into cph-cachet:master Dec 29, 2021
bardram added a commit that referenced this pull request Dec 29, 2021
@bardram
Copy link
Contributor

bardram commented Dec 29, 2021

This PR has been merged and published as version 3.4.0 of the plugin.

Thanks for the PR and sorry about the delay -- not my day job to monitor these plugins.

@dkbast - and others - please check this on Android too. Have only been testing on iOS.

Fasust pushed a commit to brancedev/flutter-plugins that referenced this pull request Dec 29, 2022
* esense_flutter 0.4.3 published

* Fix a minor typo healt -> health

* Add if statement for starting foreground service

* try to add apple exercise time

* fix hksample type

* try to fix unit error

* add workout support

* refactor, add missing info

* carp_background_location 3.0.0 published

* activity_recognition_flutter 4.0.5+1 published

* health 3.2.0

* carp_background_location 3.0.1 published

* noise_meter 3.0.3 published

* audio_streamer README update

* DISTANCE_DELTA is for Android, not iOS

* Added Healthkit Write support

* Added Apple HealthKit support for dietary energy, carbs, protein, and fats

* Added forced expiratory volume 1 second

* implemented writeData on Android and iOS

* returns result on the main thread

* aaded the endTime argument

* unit conversion for glucose

* added device name

* Updated device_info_plus dependency version

* [health 3.2.1] Updated device_info_plus dependency version

* health 3.3.0 published

* fix: added missing READ_ACCESS

* PR cph-cachet#428 and cph-cachet#454 merged

* AddSleepInBed

* Add SLEP_IN_BED to androiddateTypes

* Filter OUT_OF_BED data

* Add the android.permission.ACTIVITY_RECOGNITION setup to the README

* Return whole sleep session if there are no finer granularity sub-components

* metric unit for weight, height and body temp.

* feat: Add method for calculating total steps

* feat: Fix return type

* feat: Rename method

* feat: Fix issues

* feat: Fix ios issues

* feat: Fix some swift issues

* added paramter and Implemented hasPermissions

* fix: android 12 intent-flag

* merge of PR cph-cachet#457 and cph-cachet#462

* Update of example app and API docs

* health v 3.4.0 published

* activity_recognition published v. 4.1.0

* small typo fix

* Update CHANGELOG.md

* moved parsing out of main thread

* using Isolate and moved parsing out of main thread

* fixed concurrent issues by tapping from thread pool and using isolate

* fixed crash by returning result to main thread

* Healthkit CategorySample

When Healthkit needs a CatergorySample the code would crash. Now checks if the unit is nothing which means that it doesn't need a quantity for the session.

* refactor of activity recognition package and release

* cleanup in mobility_features

* health version: 3.4.1 published

* update API and README docs in health plugin

* misc cleanup and refactor in health plugin

* Update pubspec.yaml

* Update README.md

* fix cph-cachet#401

* health 3.4.3 published

* Update README.md

* Update README.md

* feat: audiogram

* feat: improve documentation

* add metada optinal param

* wip

* add audiogram ids

* feat: getAudiogramsIds

* fix metadata of the example and inc os version support

* fix for optional metadata

* [audio_streamer] Upgraded dependencies

* Stop recording in onDetachedFromEngine

* Fixed example

* Flutter plugin template updates

* Fixed example

* Call onCancel in onDetachedFromEngine

* audio_streamer v. 2.1.0 published

* Fix of cph-cachet#500 - BMI unit value

* WIP

* esense_flutter Android embedding v2

* Update esense_flutter.dart

* esense_flutter 0.6.0 published

* Added Headache data to iOS

* Changelog update

* update readme

* noise_meter v 3.1.0 published

* esense_flutter v 0.6.1 published

* gitignore update

* gitignore update

* gitignore update

* gitignore cleanup

* pbxproj file fix

* README spelling fix

* gitignore set to flutter default

* WIP - PR audiograms

* Audiograms added

* misc. .gitignore

* Initial E4 plugin skeleton

* fleshed out the beginning of the android e4 manager

* removed copy/pasta artefacts from eSense plugin

* Pass in the apiKey as argument

* Set up empamanager

* Empatica needs sdk version 19 or higher

* more safely implemented methods where methods are named and not just strings

* deleted old way

* cleaned up the return statement in auth with api key method

* I've managed to build the aar now. This makes intellisense show up

This intellisense means we can't code split, as it does not work as such. Will have to think of a good solution to this.

* Didn't need to "build" per say. Just making a .pom file was enough

* Still need to have it as a dependency

* Updated to gradle 7

* implemented methods from documentation

also thinking about how to test

* Maybe successful code splitting?

* first implementations of callbacks

* Have no idea if this works or not...

* Hooking the plugin up to Flutter

* Copied Bardram's mainthreadeventsink

* Implemented last event stream methods

I also found a package that does all the pom and xml creation for Flutter to recognize the .aar file without having to upload the build folder

* onMethodCall implemented. Time to test 🤞🏻

* Made it more secure. Still dreading testing.

* Apparently we need to test it in flutter... soo

* Starting dart portion

* Fixes so the example app will work

* Let's try the first thing again

* methodchannel works now. trying to set up eventchannel.

callbacks are working. trying to connect to device.

* updateStatus now correctly calls back

* readying up for dataStream as well

* modelled status events

* Working demo. Receiving data.

* simplified a little

* added all the data from the device in to the example app and even more housekeeping

* Fixed IBI because of spelling error

* ugh frustration

* successful code splitting!

* The code works

* code split methodcallhandler in to the handler

* added javadoc and disconnect method

* Updated Linter to Flutter 3's linter

* Inputting the data model from data and status events in dart

This makes the stream way more type safe and data safe, and allows the developer to see the types of data coming in

* documentation main

* upgrade gradle

* Make sure to ask for Location Data for some reason

* Change required android version

* make sure the example app runs in the background so as to not kill the connection

* log battery levels when available

* [Health 4.0.0] Audiogram & Workouts added + refactor + bug fixes

* [Health 4.0.0] Small fixes to example app and Android

* [Health 4.0.0] Readme update

* [Health 4.0.0] Readme fix

* gitignore remove file

* [Health] Small fix to example app

* [Health] Changed iOS large calorie to kilocalorie

* [Health] Small fixes

* added the last remaining methods from empatica

* removed battery logging as it is not necessary for the app to work

also accompanying packages

* Fix typos and consistent single quote strings

* Add name to didDiscoverDevice callback

* Change back mistakenly edited file

* Misspelled receive in data events

* Removed authenticateWithConnectUser as this was a relic of Empatica app

* Audio Streamer upgraded to Dart 2.17 and Flutter 3.0

* flutter pub outdated -- update to latest versions

* Added the DISCOVERING status when scanning

* fix of cph-cachet#572

* Updated README, LICENSE, CHANGELOG

* update README

* Create dependency-review.yml

* Omit unused docs folder

* Beginning of Swift implementation

* Fixed bad memory access in HKSampleQuery query.

getData query sometimes give a bad memory access error.
The work around is to access dictionary outside closure.

* Revert "Beginning of Swift implementation"

This reverts commit 08282cb.

* [Health] Bug fix of cph-cachet#553

* Deleting iOS from plugin + cleanup via reimplementation of plugin temp

* fix: removed sleep consent being asked on querying workouts

* Working version -- permission + android update + clean

* upgrade to device_info_plus: ^7.0.0

* [Health] Retrieval of ECG on iOS

- Implement retrieval of ECG data (voltage, average BPM and classification)
- Do not allow to request WRITE permission on ELECTROCARDIOGRAM
- Update README.md

* health upgrade to device_info_plus ^8.0.0

* Update README.md

Suggest adding a little bit more info on how to enable Healthkit for iOS

* Update app_usage.dart

* Update Stats.java

* Update app_usage.dart

* [movisens_flutter] Rebuilt package with dart

* Movisens 1.0.0

* Update README.md

* Upgrade of example app to AndroidX & gradle build versions

* update of docs

* Removal of support for iOS

* v 2.1.0 published

* Fixed faulty JSON unit export for HealthDataPoint

* [Health 4.4.0] Release of merged PRs

* Update app_usage.dart

bug fix

* Update build.gradle

update compileSdkVersion such that getLastTimeForegroundServiceUsed is available

* Update Stats.java

only do getLastTimeForegroundServiceUsed if correct android version

* app_usage v. 2.1.1 published

* Added podspec file to published version of esense

Also remove flutter generated files from esense plugin, and bumped version for publishing

* Removed iOS + Prepare for release

* Update empatica plugin version

* ignore unused element

Co-authored-by: bardram <jakba@dtu.dk>
Co-authored-by: Rinas Muhammed <5433320+onerinas@users.noreply.github.com>
Co-authored-by: Koen Niemeijer <koen.niemeijer@kuleuven.be>
Co-authored-by: Alexander Maslov <alex@maslov.dev>
Co-authored-by: John Zaccone <john.zaccone@gmail.com>
Co-authored-by: Matthew Pitzer <matthew.pitzer@cognosante.com>
Co-authored-by: Kin Mak <kin.mak@cappable.com>
Co-authored-by: Mads Christensen <s174238@student.dtu.dk>
Co-authored-by: sztyr <54115527+sztyr@users.noreply.github.com>
Co-authored-by: PinkyUni <anya.beliatskaya.751001@gmail.com>
Co-authored-by: altanod <altanod0627@gmail.com>
Co-authored-by: Daniel Rodenberg <drodenberg92@gmail.com>
Co-authored-by: Pierre Bresson <pierre@bresson.io>
Co-authored-by: Pierre Bresson <PierreBresson@users.noreply.github.com>
Co-authored-by: Rexios <rexios@rexios.dev>
Co-authored-by: Lars Refsgaard <1552887+lkbr1808@users.noreply.github.com>
Co-authored-by: Lars Refsgaard <1552887+LarsRefsgaard@users.noreply.github.com>
Co-authored-by: Alex Olah <38317944+xelahalo@users.noreply.github.com>
Co-authored-by: Alex Olah <olahalex8@gmail.com>
Co-authored-by: Sronglong <chhem.sronglong@gmail.com>
Co-authored-by: Ramin Shams <rshams@dius.com.au>
Co-authored-by: Fabio Codiglioni <fabiocody@icloud.com>
Co-authored-by: Leigha Jarett <leighaj@google.com>
Co-authored-by: sc00n <48179232+sc00n@users.noreply.github.com>
Co-authored-by: Mads Vedel Saaby Christensen <37549483+MadsVSChristensen@users.noreply.github.com>
Co-authored-by: L. Gehring <44134586+lgehring@users.noreply.github.com>
Fasust pushed a commit to brancedev/flutter-plugins that referenced this pull request Dec 29, 2022
* Add if statement for starting foreground service

* try to add apple exercise time

* fix hksample type

* try to fix unit error

* add workout support

* refactor, add missing info

* carp_background_location 3.0.0 published

* activity_recognition_flutter 4.0.5+1 published

* health 3.2.0

* carp_background_location 3.0.1 published

* noise_meter 3.0.3 published

* audio_streamer README update

* DISTANCE_DELTA is for Android, not iOS

* Added Healthkit Write support

* Added Apple HealthKit support for dietary energy, carbs, protein, and fats

* Added forced expiratory volume 1 second

* implemented writeData on Android and iOS

* returns result on the main thread

* aaded the endTime argument

* unit conversion for glucose

* added device name

* Updated device_info_plus dependency version

* [health 3.2.1] Updated device_info_plus dependency version

* health 3.3.0 published

* fix: added missing READ_ACCESS

* PR cph-cachet#428 and cph-cachet#454 merged

* AddSleepInBed

* Add SLEP_IN_BED to androiddateTypes

* Filter OUT_OF_BED data

* Add the android.permission.ACTIVITY_RECOGNITION setup to the README

* Return whole sleep session if there are no finer granularity sub-components

* metric unit for weight, height and body temp.

* feat: Add method for calculating total steps

* feat: Fix return type

* feat: Rename method

* feat: Fix issues

* feat: Fix ios issues

* feat: Fix some swift issues

* added paramter and Implemented hasPermissions

* fix: android 12 intent-flag

* merge of PR cph-cachet#457 and cph-cachet#462

* Update of example app and API docs

* health v 3.4.0 published

* activity_recognition published v. 4.1.0

* small typo fix

* Update CHANGELOG.md

* moved parsing out of main thread

* using Isolate and moved parsing out of main thread

* fixed concurrent issues by tapping from thread pool and using isolate

* fixed crash by returning result to main thread

* Healthkit CategorySample

When Healthkit needs a CatergorySample the code would crash. Now checks if the unit is nothing which means that it doesn't need a quantity for the session.

* refactor of activity recognition package and release

* cleanup in mobility_features

* health version: 3.4.1 published

* update API and README docs in health plugin

* misc cleanup and refactor in health plugin

* Update pubspec.yaml

* Update README.md

* fix cph-cachet#401

* health 3.4.3 published

* Update README.md

* Update README.md

* feat: audiogram

* feat: improve documentation

* add metada optinal param

* wip

* add audiogram ids

* feat: getAudiogramsIds

* fix metadata of the example and inc os version support

* fix for optional metadata

* [audio_streamer] Upgraded dependencies

* Stop recording in onDetachedFromEngine

* Fixed example

* Flutter plugin template updates

* Fixed example

* Call onCancel in onDetachedFromEngine

* audio_streamer v. 2.1.0 published

* Fix of cph-cachet#500 - BMI unit value

* WIP

* esense_flutter Android embedding v2

* Update esense_flutter.dart

* esense_flutter 0.6.0 published

* Added Headache data to iOS

* Changelog update

* update readme

* noise_meter v 3.1.0 published

* esense_flutter v 0.6.1 published

* gitignore update

* gitignore update

* gitignore update

* gitignore cleanup

* pbxproj file fix

* README spelling fix

* gitignore set to flutter default

* WIP - PR audiograms

* Audiograms added

* misc. .gitignore

* Initial E4 plugin skeleton

* fleshed out the beginning of the android e4 manager

* removed copy/pasta artefacts from eSense plugin

* Pass in the apiKey as argument

* Set up empamanager

* Empatica needs sdk version 19 or higher

* more safely implemented methods where methods are named and not just strings

* deleted old way

* cleaned up the return statement in auth with api key method

* I've managed to build the aar now. This makes intellisense show up

This intellisense means we can't code split, as it does not work as such. Will have to think of a good solution to this.

* Didn't need to "build" per say. Just making a .pom file was enough

* Still need to have it as a dependency

* Updated to gradle 7

* implemented methods from documentation

also thinking about how to test

* Maybe successful code splitting?

* first implementations of callbacks

* Have no idea if this works or not...

* Hooking the plugin up to Flutter

* Copied Bardram's mainthreadeventsink

* Implemented last event stream methods

I also found a package that does all the pom and xml creation for Flutter to recognize the .aar file without having to upload the build folder

* onMethodCall implemented. Time to test 🤞🏻

* Made it more secure. Still dreading testing.

* Apparently we need to test it in flutter... soo

* Starting dart portion

* Fixes so the example app will work

* Let's try the first thing again

* methodchannel works now. trying to set up eventchannel.

callbacks are working. trying to connect to device.

* updateStatus now correctly calls back

* readying up for dataStream as well

* modelled status events

* Working demo. Receiving data.

* simplified a little

* added all the data from the device in to the example app and even more housekeeping

* Fixed IBI because of spelling error

* ugh frustration

* successful code splitting!

* The code works

* code split methodcallhandler in to the handler

* added javadoc and disconnect method

* Updated Linter to Flutter 3's linter

* Inputting the data model from data and status events in dart

This makes the stream way more type safe and data safe, and allows the developer to see the types of data coming in

* documentation main

* upgrade gradle

* Make sure to ask for Location Data for some reason

* Change required android version

* make sure the example app runs in the background so as to not kill the connection

* log battery levels when available

* [Health 4.0.0] Audiogram & Workouts added + refactor + bug fixes

* [Health 4.0.0] Small fixes to example app and Android

* [Health 4.0.0] Readme update

* [Health 4.0.0] Readme fix

* gitignore remove file

* [Health] Small fix to example app

* [Health] Changed iOS large calorie to kilocalorie

* [Health] Small fixes

* added the last remaining methods from empatica

* removed battery logging as it is not necessary for the app to work

also accompanying packages

* Fix typos and consistent single quote strings

* Add name to didDiscoverDevice callback

* Change back mistakenly edited file

* Misspelled receive in data events

* Removed authenticateWithConnectUser as this was a relic of Empatica app

* Audio Streamer upgraded to Dart 2.17 and Flutter 3.0

* flutter pub outdated -- update to latest versions

* Added the DISCOVERING status when scanning

* fix of cph-cachet#572

* Updated README, LICENSE, CHANGELOG

* update README

* Create dependency-review.yml

* Omit unused docs folder

* Beginning of Swift implementation

* Fixed bad memory access in HKSampleQuery query.

getData query sometimes give a bad memory access error.
The work around is to access dictionary outside closure.

* Revert "Beginning of Swift implementation"

This reverts commit 08282cb.

* [Health] Bug fix of cph-cachet#553

* Deleting iOS from plugin + cleanup via reimplementation of plugin temp

* fix: removed sleep consent being asked on querying workouts

* Working version -- permission + android update + clean

* upgrade to device_info_plus: ^7.0.0

* [Health] Retrieval of ECG on iOS

- Implement retrieval of ECG data (voltage, average BPM and classification)
- Do not allow to request WRITE permission on ELECTROCARDIOGRAM
- Update README.md

* health upgrade to device_info_plus ^8.0.0

* Update README.md

Suggest adding a little bit more info on how to enable Healthkit for iOS

* Update app_usage.dart

* Update Stats.java

* Update app_usage.dart

* [movisens_flutter] Rebuilt package with dart

* Movisens 1.0.0

* Update README.md

* Upgrade of example app to AndroidX & gradle build versions

* update of docs

* Removal of support for iOS

* v 2.1.0 published

* Fixed faulty JSON unit export for HealthDataPoint

* [Health 4.4.0] Release of merged PRs

* Update app_usage.dart

bug fix

* Update build.gradle

update compileSdkVersion such that getLastTimeForegroundServiceUsed is available

* Update Stats.java

only do getLastTimeForegroundServiceUsed if correct android version

* app_usage v. 2.1.1 published

* Added podspec file to published version of esense

Also remove flutter generated files from esense plugin, and bumped version for publishing

* Removed iOS + Prepare for release

* Update empatica plugin version

* ignore unused element

* refactoring

Co-authored-by: Koen Niemeijer <koen.niemeijer@kuleuven.be>
Co-authored-by: Alexander Maslov <alex@maslov.dev>
Co-authored-by: bardram <jakba@dtu.dk>
Co-authored-by: John Zaccone <john.zaccone@gmail.com>
Co-authored-by: Matthew Pitzer <matthew.pitzer@cognosante.com>
Co-authored-by: Kin Mak <kin.mak@cappable.com>
Co-authored-by: Mads Christensen <s174238@student.dtu.dk>
Co-authored-by: sztyr <54115527+sztyr@users.noreply.github.com>
Co-authored-by: PinkyUni <anya.beliatskaya.751001@gmail.com>
Co-authored-by: altanod <altanod0627@gmail.com>
Co-authored-by: Daniel Rodenberg <drodenberg92@gmail.com>
Co-authored-by: Pierre Bresson <pierre@bresson.io>
Co-authored-by: Pierre Bresson <PierreBresson@users.noreply.github.com>
Co-authored-by: Rexios <rexios@rexios.dev>
Co-authored-by: Lars Refsgaard <1552887+lkbr1808@users.noreply.github.com>
Co-authored-by: Lars Refsgaard <1552887+LarsRefsgaard@users.noreply.github.com>
Co-authored-by: Alex Olah <38317944+xelahalo@users.noreply.github.com>
Co-authored-by: Alex Olah <olahalex8@gmail.com>
Co-authored-by: Sronglong <chhem.sronglong@gmail.com>
Co-authored-by: Ramin Shams <rshams@dius.com.au>
Co-authored-by: Fabio Codiglioni <fabiocody@icloud.com>
Co-authored-by: Leigha Jarett <leighaj@google.com>
Co-authored-by: sc00n <48179232+sc00n@users.noreply.github.com>
Co-authored-by: Mads Vedel Saaby Christensen <37549483+MadsVSChristensen@users.noreply.github.com>
Co-authored-by: L. Gehring <44134586+lgehring@users.noreply.github.com>
hibitness-quan-nguyen2 pushed a commit to hibitness/flutter-plugins that referenced this pull request Dec 18, 2023
Fixed (regression) issues with metric and permissions
hibitness-quan-nguyen2 pushed a commit to hibitness/flutter-plugins that referenced this pull request Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants